summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Farmer <gmbr3@opensuse.org>2023-04-28 17:46:24 +0100
committerCallum Farmer <gmbr3@opensuse.org>2023-05-04 14:29:36 +0100
commite2aa099738e1bd527929b5fb6fe7312962b6b4e4 (patch)
tree50212479249b73390ee018662048017746822a98
parent4c938fac30954a54456300bcdad2fdd0b34b6210 (diff)
downloadgnu-efi-e2aa099738e1bd527929b5fb6fe7312962b6b4e4.tar.gz
lds: Support ctors/dtors with a priority
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r--gnuefi/elf_aarch64_efi.lds20
-rw-r--r--gnuefi/elf_arm_efi.lds20
-rw-r--r--gnuefi/elf_ia32_efi.lds20
-rw-r--r--gnuefi/elf_ia32_fbsd_efi.lds20
-rw-r--r--gnuefi/elf_ia64_efi.lds20
-rw-r--r--gnuefi/elf_mips64el_efi.lds20
-rw-r--r--gnuefi/elf_x86_64_efi.lds20
-rw-r--r--gnuefi/elf_x86_64_fbsd_efi.lds20
8 files changed, 96 insertions, 64 deletions
diff --git a/gnuefi/elf_aarch64_efi.lds b/gnuefi/elf_aarch64_efi.lds
index 343956c..7657bb3 100644
--- a/gnuefi/elf_aarch64_efi.lds
+++ b/gnuefi/elf_aarch64_efi.lds
@@ -49,16 +49,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -84,10 +88,10 @@ SECTIONS
*(.rela.got)
*(.rela.dyn)
*(.rela.stab)
- *(.rela.init_array)
- *(.rela.fini_array)
- *(.rela.ctors)
- *(.rela.dtors)
+ *(.rela.init_array*)
+ *(.rela.fini_array*)
+ *(.rela.ctors*)
+ *(.rela.dtors*)
}
. = ALIGN(4096);
diff --git a/gnuefi/elf_arm_efi.lds b/gnuefi/elf_arm_efi.lds
index 4b0f032..3c9f919 100644
--- a/gnuefi/elf_arm_efi.lds
+++ b/gnuefi/elf_arm_efi.lds
@@ -36,16 +36,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -70,10 +74,10 @@ SECTIONS
*(.rel.got)
*(.rel.dyn)
*(.rel.stab)
- *(.rel.init_array)
- *(.rel.fini_array)
- *(.rel.ctors)
- *(.rel.dtors)
+ *(.rel.init_array*)
+ *(.rel.fini_array*)
+ *(.rel.ctors*)
+ *(.rel.dtors*)
}
. = ALIGN(4096);
diff --git a/gnuefi/elf_ia32_efi.lds b/gnuefi/elf_ia32_efi.lds
index 8694d82..964530c 100644
--- a/gnuefi/elf_ia32_efi.lds
+++ b/gnuefi/elf_ia32_efi.lds
@@ -40,16 +40,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -70,10 +74,10 @@ SECTIONS
*(.rel.got)
*(.rel.dyn)
*(.rel.stab)
- *(.rel.init_array)
- *(.rel.fini_array)
- *(.rel.ctors)
- *(.rel.dtors)
+ *(.rel.init_array*)
+ *(.rel.fini_array*)
+ *(.rel.ctors*)
+ *(.rel.dtors*)
*(.data.rel.ro.local)
*(.data.rel.local)
*(.data.rel.ro)
diff --git a/gnuefi/elf_ia32_fbsd_efi.lds b/gnuefi/elf_ia32_fbsd_efi.lds
index 3ecdc62..c5c5dae 100644
--- a/gnuefi/elf_ia32_fbsd_efi.lds
+++ b/gnuefi/elf_ia32_fbsd_efi.lds
@@ -49,16 +49,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -80,10 +84,10 @@ SECTIONS
*(.rel.data.*)
*(.rel.got)
*(.rel.stab)
- *(.rel.init_array)
- *(.rel.fini_array)
- *(.rel.ctors)
- *(.rel.dtors)
+ *(.rel.init_array*)
+ *(.rel.fini_array*)
+ *(.rel.ctors*)
+ *(.rel.dtors*)
*(.data.rel.ro.local)
*(.data.rel.local)
*(.data.rel.ro)
diff --git a/gnuefi/elf_ia64_efi.lds b/gnuefi/elf_ia64_efi.lds
index de51acf..f85cb91 100644
--- a/gnuefi/elf_ia64_efi.lds
+++ b/gnuefi/elf_ia64_efi.lds
@@ -50,16 +50,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -82,10 +86,10 @@ SECTIONS
*(.rela.dyn)
*(.rela.gnu.linkonce.d*)
*(.rela.stab)
- *(.rela.init_array)
- *(.rela.fini_array)
- *(.rela.ctors)
- *(.rela.dtors)
+ *(.rela.init_array*)
+ *(.rela.fini_array*)
+ *(.rela.ctors*)
+ *(.rela.dtors*)
}
. = ALIGN(4096);
.rela.plt : { *(.rela.plt) }
diff --git a/gnuefi/elf_mips64el_efi.lds b/gnuefi/elf_mips64el_efi.lds
index b522bbc..80312bf 100644
--- a/gnuefi/elf_mips64el_efi.lds
+++ b/gnuefi/elf_mips64el_efi.lds
@@ -37,16 +37,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -70,10 +74,10 @@ SECTIONS
*(.rel.got)
*(.rel.dyn)
*(.rel.stab)
- *(.rel.init_array)
- *(.rel.fini_array)
- *(.rel.ctors)
- *(.rel.dtors)
+ *(.rel.init_array*)
+ *(.rel.fini_array*)
+ *(.rel.ctors*)
+ *(.rel.dtors*)
}
. = ALIGN(4096);
.rel.plt : { *(.rel.plt) }
diff --git a/gnuefi/elf_x86_64_efi.lds b/gnuefi/elf_x86_64_efi.lds
index 4aea2da..c9564a2 100644
--- a/gnuefi/elf_x86_64_efi.lds
+++ b/gnuefi/elf_x86_64_efi.lds
@@ -47,16 +47,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -82,10 +86,10 @@ SECTIONS
*(.rela.got)
*(.rela.dyn)
*(.rela.stab)
- *(.rela.init_array)
- *(.rela.fini_array)
- *(.rela.ctors)
- *(.rela.dtors)
+ *(.rela.init_array*)
+ *(.rela.fini_array*)
+ *(.rela.ctors*)
+ *(.rela.dtors*)
}
. = ALIGN(4096);
.rela.plt : { *(.rela.plt) }
diff --git a/gnuefi/elf_x86_64_fbsd_efi.lds b/gnuefi/elf_x86_64_fbsd_efi.lds
index 0eb7299..e8a6825 100644
--- a/gnuefi/elf_x86_64_fbsd_efi.lds
+++ b/gnuefi/elf_x86_64_fbsd_efi.lds
@@ -45,16 +45,20 @@ SECTIONS
*/
. = ALIGN(16);
_init_array = .;
- *(SORT_BY_NAME(.init_array))
+ *(SORT(.init_array.*))
+ *(.init_array)
_init_array_end = .;
__CTOR_LIST__ = .;
- *(SORT_BY_NAME(.ctors))
+ *(SORT(.ctors.*))
+ *(.ctors)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
- *(SORT_BY_NAME(.dtors))
+ *(SORT(.dtors.*))
+ *(.dtors)
__DTOR_END__ = .;
_fini_array = .;
- *(SORT_BY_NAME(.fini_array))
+ *(SORT(.fini_array.*))
+ *(.fini_array)
_fini_array_end = .;
/* the EFI loader doesn't seem to like a .bss section, so we stick
@@ -76,10 +80,10 @@ SECTIONS
*(.rela.data*)
*(.rela.got)
*(.rela.stab)
- *(.rela.init_array)
- *(.rela.fini_array)
- *(.rela.ctors)
- *(.rela.dtors)
+ *(.rela.init_array*)
+ *(.rela.fini_array*)
+ *(.rela.ctors*)
+ *(.rela.dtors*)
}
_edata = .;
_data_size = . - _etext;