antmicro / zynq-mkbootimage

An open source replacement of the Xilinx bootgen application.
BSD 2-Clause "Simplified" License
99 stars 49 forks source link

Fix assumptions about ELF file layout (issue #6) #7

Closed anssih closed 6 years ago

anssih commented 6 years ago

Fix handling of several cases in the ELF code:

The first case is encountered at least in some PMUFW ELF files. The second case is encountered at least in some PMUFW ELF files on Vivado 2018.1.

The elf_find_offsets() function is merged into elf_append() as they are always called in pairs and having elf_append() continue to work without libelf calls would have required elf_find_offsets() to pass much more information for elf_append().


I haven't tested this extensively, but with this change I seemed to get bootable images again (PMUFW+FSBL+ATF+u-boot for ZynqMP).

tgorochowik commented 6 years ago

Great job, thanks!