frederic / aml_bootloader_tool

parse and regenerate the SHA-256 of bootloaders for Amlogic S905 SoC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault (core dumped)

Raxone opened this issue · comments

Segmentation fault (core dumped)

./aml_bootloader_tool bootloader.img H 2
fip_toc_header.name: a75a7544
fip_toc_header.serial_number: dd3ee05d
fip_toc_header.flags: 1712b7f29c66abdd
TOC ENTRY #2
fip_toc_entry.uuid: D3136362812394885C6DB30F12F9AB3C
fip_toc_entry.offset_address: 40ed74bc5e380543 (absolute: 0x40ed74bc5e38c543)
fip_toc_entry.size: 0xed657f44e4390d49
fip_toc_entry.flags: 0xd3b00658f0bfed06
Segmentation fault (core dumped)

Dmesg

traps: aml_bootloader_[4131] general protection fault ip:7fc73d14067d sp:7ffeba1897c8 error:0 in libc-2.27.so[7fc73cfb2000+1e7000]

Compile error

gcc -o aml_bootloader_tool -ltomcrypt aml_bootloader_tool.c

/tmp/cc5Kjhr8.o: In function hash_aml_img': aml_bootloader_tool.c:(.text+0x90): undefined reference to sha256_desc'
aml_bootloader_tool.c:(.text+0x95): undefined reference to register_hash' aml_bootloader_tool.c:(.text+0xa4): undefined reference to sha256_init'
aml_bootloader_tool.c:(.text+0x13d): undefined reference to sha256_process' aml_bootloader_tool.c:(.text+0x179): undefined reference to sha256_process'
aml_bootloader_tool.c:(.text+0x1b1): undefined reference to sha256_process' aml_bootloader_tool.c:(.text+0x1ca): undefined reference to sha256_done'
collect2: error: ld returned 1 exit status

Fix compile just move lib to and

gcc -o aml_bootloader_tool aml_bootloader_tool.c -ltomcrypt