summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Farmer <gmbr3@opensuse.org>2023-03-22 15:30:04 +0000
committerCallum Farmer <gmbr3@opensuse.org>2023-03-22 15:32:24 +0000
commitbc233a7a4b1eef18e85928117d3851bf4bb94836 (patch)
tree4afc17a499de2e9703dc752c3dc5cc1a8fcd51a1
parent0f9c15fe4fd4b37691fdb505794b0d73df21d4d5 (diff)
downloadgnu-efi-bc233a7a4b1eef18e85928117d3851bf4bb94836.tar.gz
Prevent deletion of .reloc by gc-sections
Add keyword KEEP to prevent .reloc being removed when using --gc-sections with GNU ld Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r--gnuefi/elf_aarch64_efi.lds2
-rw-r--r--gnuefi/elf_ia32_efi.lds2
-rw-r--r--gnuefi/elf_ia64_efi.lds2
-rw-r--r--gnuefi/elf_x86_64_efi.lds2
4 files changed, 4 insertions, 4 deletions
diff --git a/gnuefi/elf_aarch64_efi.lds b/gnuefi/elf_aarch64_efi.lds
index 468afb8..c02ea5c 100644
--- a/gnuefi/elf_aarch64_efi.lds
+++ b/gnuefi/elf_aarch64_efi.lds
@@ -26,7 +26,7 @@ SECTIONS
. = ALIGN(4096);
.reloc :
{
- *(.reloc)
+ KEEP (*(.reloc))
}
. = ALIGN(65536);
.dynamic : { *(.dynamic) }
diff --git a/gnuefi/elf_ia32_efi.lds b/gnuefi/elf_ia32_efi.lds
index 9db9328..98fa6a5 100644
--- a/gnuefi/elf_ia32_efi.lds
+++ b/gnuefi/elf_ia32_efi.lds
@@ -75,7 +75,7 @@ SECTIONS
. = ALIGN(4096);
.reloc : /* This is the PECOFF .reloc section! */
{
- *(.reloc)
+ KEEP (*(.reloc))
}
. = ALIGN(4096);
.dynsym : { *(.dynsym) }
diff --git a/gnuefi/elf_ia64_efi.lds b/gnuefi/elf_ia64_efi.lds
index 0a217e4..0d6996b 100644
--- a/gnuefi/elf_ia64_efi.lds
+++ b/gnuefi/elf_ia64_efi.lds
@@ -70,7 +70,7 @@ SECTIONS
. = ALIGN(4096);
.reloc : /* This is the PECOFF .reloc section! */
{
- *(.reloc)
+ KEEP (*(.reloc))
}
. = ALIGN(4096);
.dynsym : { *(.dynsym) }
diff --git a/gnuefi/elf_x86_64_efi.lds b/gnuefi/elf_x86_64_efi.lds
index 2f0ecaa..9ec9cc1 100644
--- a/gnuefi/elf_x86_64_efi.lds
+++ b/gnuefi/elf_x86_64_efi.lds
@@ -26,7 +26,7 @@ SECTIONS
. = ALIGN(4096);
.reloc :
{
- *(.reloc)
+ KEEP (*(.reloc))
}
. = ALIGN(4096);
.data :