aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-06-28 14:29:51 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-06-28 14:36:52 +0100
commita17fdfb873bebc135a73580a493913cdec066f28 (patch)
tree81dc6147cb18f23a7d78fb9a9eda5b9251fe0778 /com32/lib
parentbf9320d4186033af250a3dd5ba6a04503c39f51b (diff)
downloadsyslinux-a17fdfb873bebc135a73580a493913cdec066f28.tar.gz
syslinux-a17fdfb873bebc135a73580a493913cdec066f28.tar.xz
syslinux-a17fdfb873bebc135a73580a493913cdec066f28.zip
com32: Catch up with GCC changes to ctor/dtor funcs
Cherry-pick commit e55d4988 ("com32: Include .init_array section in .ctors in linker script") from the elflink branch. People were seeing this bug manifest as an error when using the CONFIG directive. Loading a new main configuration file causes ldlinux.* to be reloaded and relies on its destructor functions being executed. This change was missed during merging because com32/lib/elf32.ld should have been deleted when we added per-architecture linker scripts. Had we done that, we'd have seen a merge conflict. Because the unused file was left around, things merged silently. Delete the unused file with extreme prejudice. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib')
-rw-r--r--com32/lib/elf32.ld171
-rw-r--r--com32/lib/i386/elf.ld15
-rw-r--r--com32/lib/x86_64/elf.ld15
3 files changed, 8 insertions, 193 deletions
diff --git a/com32/lib/elf32.ld b/com32/lib/elf32.ld
deleted file mode 100644
index 16d10a38..00000000
--- a/com32/lib/elf32.ld
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Linker script for ELF dynamic loaded modules.
- */
-
-/* Script for --shared -z combreloc: shared library, combine & sort relocs */
-OUTPUT_FORMAT("elf32-i386", "elf32-i386",
- "elf32-i386")
-OUTPUT_ARCH(i386)
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0 + SIZEOF_HEADERS;
- .note.gnu.build-id : { *(.note.gnu.build-id) }
- .hash : { *(.hash) }
- .gnu.hash : { *(.gnu.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .rel.dyn :
- {
- *(.rel.init)
- *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
- *(.rel.fini)
- *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
- *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
- *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
- *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
- *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
- *(.rel.ctors)
- *(.rel.dtors)
- *(.rel.got)
- *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
- }
- .rela.dyn :
- {
- *(.rela.init)
- *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
- *(.rela.fini)
- *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
- *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
- *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
- *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
- *(.rela.ctors)
- *(.rela.dtors)
- *(.rela.got)
- *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
- }
- .rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
- .init :
- {
- KEEP (*(.init))
- } =0x90909090
- .plt : { *(.plt) }
- .text :
- {
- *(.text .stub .text.* .gnu.linkonce.t.*)
- KEEP (*(.text.*personality*))
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- } =0x90909090
- .fini :
- {
- KEEP (*(.fini))
- } =0x90909090
- PROVIDE (__etext = .);
- PROVIDE (_etext = .);
- PROVIDE (etext = .);
- .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
- .rodata1 : { *(.rodata1) }
- . = ALIGN(4);
- .preinit_array :
- {
- KEEP (*(.preinit_array))
- }
- .ctors :
- {
- __ctors_start = .;
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- KEEP (*(.ctors_modinit))
- KEEP (*(.ctors_modmain))
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- __ctors_end = .;
- }
-
- .dtors :
- {
- __dtors_start = .;
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
- KEEP (*(.dtors_modexit))
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- __dtors_end = .;
- }
-
- .jcr : { KEEP (*(.jcr)) }
- .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
- .dynamic : { *(.dynamic) }
- .got : { *(.got) }
- /*. = DATA_SEGMENT_RELRO_END (12, .); -> This gives a "invalid assignment to location counter" error */
- .got.plt : { *(.got.plt) }
- .data :
- {
- *(.data .data.* .gnu.linkonce.d.*)
- KEEP (*(.gnu.linkonce.d.*personality*))
- SORT(CONSTRUCTORS)
- }
- .data1 : { *(.data1) }
- PROVIDE (edata = .);
- PROVIDE (_edata = .);
- .bss :
- {
- *(.dynbss)
- *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- . = ALIGN(. != 0 ? 32 / 8 : 1);
- }
- . = ALIGN(32 / 8);
- . = ALIGN(32 / 8);
- PROVIDE (_end = .);
- PROVIDE (end = .);
- /*. = DATA_SEGMENT_END (.); -> This gives a "invalid assignment to location counter" error */
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* DWARF 3 */
- .debug_pubtypes 0 : { *(.debug_pubtypes) }
- .debug_ranges 0 : { *(.debug_ranges) }
- .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
- /DISCARD/ : { *(.eh_frame) }
-}
diff --git a/com32/lib/i386/elf.ld b/com32/lib/i386/elf.ld
index fc2e7db5..e0705cf9 100644
--- a/com32/lib/i386/elf.ld
+++ b/com32/lib/i386/elf.ld
@@ -75,17 +75,6 @@ SECTIONS
{
KEEP (*(.preinit_array))
}
- .init_array :
- {
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- }
- .fini_array :
- {
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- }
-
.ctors :
{
__ctors_start = .;
@@ -93,6 +82,8 @@ SECTIONS
KEEP (*(.ctors))
KEEP (*(.ctors_modinit))
KEEP (*(.ctors_modmain))
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
__ctors_end = .;
}
@@ -102,6 +93,8 @@ SECTIONS
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(.dtors_modexit))
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
__dtors_end = .;
}
diff --git a/com32/lib/x86_64/elf.ld b/com32/lib/x86_64/elf.ld
index 4e88bcb0..10ee7c44 100644
--- a/com32/lib/x86_64/elf.ld
+++ b/com32/lib/x86_64/elf.ld
@@ -76,17 +76,6 @@ SECTIONS
{
KEEP (*(.preinit_array))
}
- .init_array :
- {
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- }
- .fini_array :
- {
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- }
-
.ctors :
{
__ctors_start = .;
@@ -94,6 +83,8 @@ SECTIONS
KEEP (*(.ctors))
KEEP (*(.ctors_modinit))
KEEP (*(.ctors_modmain))
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
__ctors_end = .;
}
@@ -103,6 +94,8 @@ SECTIONS
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*(.dtors_modexit))
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
__dtors_end = .;
}