You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
3f0beb9fa3
Currently, loading an ELF image will relocate the image (to its preferred load address) only if there is at least one ELF segment that is not completely contained in the file loaded (i.e. the memory segment size is larger than the size inside the file. This behavior is generally triggered by the segment that contains the .bss section). Consequently, images that contain initialized data only (e.g. QNX IFS files) don't get relocated, and will usually crash when jumping to the image entry point. This change checks whether the ELF image is already loaded at the preferred address, and forces image relocation if not. Signed-off-by: Bruno Achauer <bruno.achauer@intel.com>