Re: [RFC PATCH 08/10] arm: efi_loader: move .dynamic out of .text in EFI

Sam Edwards
2023-05-22T17:13:37Z

On 5/22/23 02:10, Heinrich Schuchardt wrote:

Hi Heinrich,

> .dynamic should be aligned. Structure Elf64_Dyn requires at least 8 byte
> alignment.

As best as I can tell, linkers (certainly lld[1], apparently also GNU ld
judging by its default linker scripts) themselves set the proper word
alignment on the .dynamic section that they synthesize for their
internal input object. That alignment requirement bubbles up to the
output section, so explicit alignment here should not be necessary.

> The symbol _etext below should be 512 aligned as in
> arch/arm/lib/crt0_aarch64_efi.S we have set FileAlignment = 0x200.

Ah, that definitely needs to be fixed since the .rela.* sections might
not have the 512 alignment. I've updated my local branch, though this
also needs to be addressed in the current master branch.

Cheers,
Sam

[1]: