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

Ilias Apalodimas
2023-05-22T07:31:15Z

Hi Sam,

On Sat, 20 May 2023 at 23:56, Sam Edwards <cfsworks@gmail.com> wrote:
>
> This is not proper: A .text section is SHT_PROGBITS,
> while the .dynamic section is SHT_DYNAMIC. Attempting to
> combine them like this creates a section type mismatch.
>
> It does seem that GNU ld does not complain, but LLVM's lld
> considers this an error.
>
> Signed-off-by: Sam Edwards <CFSworks@gmail.com>
> Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>
> arch/arm/lib/elf_aarch64_efi.lds | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/elf_aarch64_efi.lds b/arch/arm/lib/elf_aarch64_efi.lds
> index 5dd9809169..986f13936d 100644
> --- a/arch/arm/lib/elf_aarch64_efi.lds
> +++ b/arch/arm/lib/elf_aarch64_efi.lds
> @@ -24,10 +24,9 @@ SECTIONS
> *(.gnu.linkonce.t.*)
> *(.srodata)
> *(.rodata*)
> - . = ALIGN(16);
> - *(.dynamic);
> . = ALIGN(512);
> }
> + .dynamic : { *(.dynamic) }
This looks correct. However, this changed recently on commit
d7ddeb66a6ce ("efi_loader: fix building aarch64 EFI binaries").

Heinrich any chance you can repeat your tests?

Thanks
/Ilias
> .rela.dyn : { *(.rela.dyn) }
> .rela.plt : { *(.rela.plt) }
> .rela.got : { *(.rela.got) }
> --
> 2.39.2
>