[U-Boot] [RFC] arch/arm/lib/reloc_aarch64_efi.c

Simon Glass sjg at chromium.org
Thu Jan 31 10:04:24 UTC 2019


Hi Heinrich,

On Sun, 20 Jan 2019 at 17:26, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> Hello Simon,
>
> unfortunately I could not find any documentation for
> arch/arm/lib/reloc_aarch64_efi.c.
>
> EFI binaries never rely on dynamically loaded libraries.
> So there will never be any dynamic symbols in an EFI binary.
> There will not be any GOT either.
>
> Relocation is handled by the firmware (e.g. in our efi_load_pe()).
>
> So it is unclear to me why the function _relocate() is needed which
> tries to deal with dynamic symbols.
>
> elf.h defines an array _DYNAMIC[] used as argument for _relocate(). But
> I could not find any place where it is actually implemented. So I assume
> that the output of _relocate() is rather undefined.
>
> As the function _relocate() was once introduced by one of your patches I
> hope you can provide me some insight, please.

The code is designed to relocate itself. If I recall correctly it came
from Linux (see headers in the files added). Perhaps Linux has to do
this since it doesn't rely on having a proper boot loader like U-Boot
to do this relocation?

So perhaps we don't need this code?

Regards,
Simon


More information about the U-Boot mailing list