[PATCH 1/1] efi_loader: fix .reloc section of arm64
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Sun Jan 8 18:20:04 CET 2023
On 1/8/23 15:19, Heinrich Schuchardt wrote:
> When adding
>
> const unsigned short *menu_items[] = {
> u"abc\n",
> u"def\n",
> NULL
> };
>
> to helloworld.c outside of a function and then referring to the variable
> in a function the pointer the reference is incorrect. This is due to not
> considering the generated relocations.
>
> Fix the linker script and the PE-COFF header.
>
> Fixes: c65d76ed5f81 ("efi: arm: Add aarch64 EFI app support")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
Debugging shows that function _relocate() finds a pointer to .rela.data
and then uses this for the self relocation.
Do this .rela.data should not be in .reloc but in .text.
Best regards
Heinrich
More information about the U-Boot
mailing list