
On 01/19/2019 12:55 PM, Heinrich Schuchardt wrote:
On 1/19/19 11:21 AM, Heinrich Schuchardt wrote:
Hello Alex,
bootefi hello fails since 5be444d14b380b210b246aa73dd5a111e4b1f80d efi_loader: consistent build flags for EFI applications
The problem is caused by incorrect entry point information in the EFI binary:
Actual positions in EFI file: 0x178 hw_memcmp.constprop.0 0x1a8 efi_main
Header information in EFI file (using https://github.com/xypron/efi_analyzer):
BaseOfCode=0x148 AddressOfEntryPoint=0x148
So AddressOfEntryPoint is not pointing to efi_main().
In arch/arm/lib/crt0_aarch64_efi.S we define AddressOfEntryPoint to point to _start. _start() calls _relocate().
We already do a relocation in efi_load_pe(). I cannot understand why the code should be relocated twice.
IIRC we don't generate PE relocations from ELF relocations. Instead, we bundle ELF relocations into its own section inside the target binary and then relocate ourselves.
So in the binary you're examining, there should be no pe relocations.
Alex