This was 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 seems that while GNU ld does not complain, LLVM's lld considers this
an error.

Signed-off-by: Sam Edwards <cfswo...@gmail.com>
Cc: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
 lib/efi_loader/elf_efi.ldsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/efi_loader/elf_efi.ldsi b/lib/efi_loader/elf_efi.ldsi
index dc4d1a3660e..acf02eba4d6 100644
--- a/lib/efi_loader/elf_efi.ldsi
+++ b/lib/efi_loader/elf_efi.ldsi
@@ -20,10 +20,10 @@ SECTIONS
                *(.gnu.linkonce.t.*)
                *(.srodata)
                *(.rodata*)
-               . = ALIGN(16);
-               *(.dynamic);
-               . = ALIGN(512);
        }
+       . = ALIGN(16);
+       .dynamic : { *(.dynamic) }
+       . = ALIGN(512);
        .rela.dyn : { *(.rela.dyn) }
        .rela.plt : { *(.rela.plt) }
        .rela.got : { *(.rela.got) }
-- 
2.45.2

Reply via email to