aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-28 21:28:52 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-05-28 21:28:52 -0700
commitb6be466444740a34bacd140dccbe57f6629b15bc (patch)
treed6ad3c9d3aa4f8f10a7fc03d3693df3ee2292d30
parenta35dce33744f649fdbc0af0da664554cccaa8248 (diff)
downloadsyslinux-b6be466444740a34bacd140dccbe57f6629b15bc.tar.gz
syslinux-b6be466444740a34bacd140dccbe57f6629b15bc.tar.xz
syslinux-b6be466444740a34bacd140dccbe57f6629b15bc.zip
com32.ld: handle .init_array and .fini_arraysyslinux-4.06-pre5
Handle constructors/destructors via .init_array and .fini_array, as generated by newer gccs. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/lib/com32.ld33
1 files changed, 10 insertions, 23 deletions
diff --git a/com32/lib/com32.ld b/com32/lib/com32.ld
index 37ee46cf..008e4ceb 100644
--- a/com32/lib/com32.ld
+++ b/com32/lib/com32.ld
@@ -36,36 +36,23 @@ SECTIONS
.rodata1 : { *(.rodata1) }
__rodata_end = .;
- /* Ensure the __preinit_array_start label is properly aligned. We
- could instead move the label definition inside the section, but
- the linker would then create the section even if it turns out to
- be empty, which isn't pretty. */
+ /*
+ * The difference betwee .ctors/.dtors and .init_array/.fini_array
+ * is the ordering, but we don't use prioritization for libcom32, so
+ * just lump them all together and hope that's okay.
+ */
. = ALIGN(4);
- .preinit_array : {
- PROVIDE (__preinit_array_start = .);
- *(.preinit_array)
- PROVIDE (__preinit_array_end = .);
- }
- .init_array : {
- PROVIDE (__init_array_start = .);
- *(.init_array)
- PROVIDE (__init_array_end = .);
- }
- .fini_array : {
- PROVIDE (__fini_array_start = .);
- *(.fini_array)
- PROVIDE (__fini_array_end = .);
- }
.ctors : {
PROVIDE (__ctors_start = .);
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
+ KEEP (*(SORT(.preinit_array*)))
+ KEEP (*(SORT(.init_array*)))
+ KEEP (*(SORT(.ctors*)))
PROVIDE (__ctors_end = .);
}
.dtors : {
PROVIDE (__dtors_start = .);
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
+ KEEP (*(SORT(.fini_array*)))
+ KEEP (*(SORT(.dtors*)))
PROVIDE (__dtors_end = .);
}