summaryrefslogtreecommitdiff
path: root/libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-08-12 15:08:54 -0300
committerAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-08-12 15:08:54 -0300
commitc0397909802567bce7228488890467d54a6cb415 (patch)
tree69583d9b28e3d3e9f924e1b577be74b83d03e114 /libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch
parenta3e2b8b1185c0e487600584e470b98a7f03c6e93 (diff)
downloadabslibre-c0397909802567bce7228488890467d54a6cb415.tar.gz
abslibre-c0397909802567bce7228488890467d54a6cb415.tar.bz2
abslibre-c0397909802567bce7228488890467d54a6cb415.zip
syslinux-4.05-6: updating version
Diffstat (limited to 'libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch')
-rw-r--r--libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch b/libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch
new file mode 100644
index 000000000..99e0d4777
--- /dev/null
+++ b/libre/syslinux/handle-ctors-dtors-via-init_array-and-fini_array.patch
@@ -0,0 +1,66 @@
+From b6be466444740a34bacd140dccbe57f6629b15bc Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" <hpa@zytor.com>
+Date: Mon, 28 May 2012 21:28:52 -0700
+Subject: [PATCH 1/1] com32.ld: handle .init_array and .fini_array
+
+Handle constructors/destructors via .init_array and .fini_array, as
+generated by newer gccs.
+
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ com32/lib/com32.ld | 33 ++++++++++-----------------------
+ 1 files changed, 10 insertions(+), 23 deletions(-)
+
+diff --git a/com32/lib/com32.ld b/com32/lib/com32.ld
+index 37ee46c..008e4ce 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 = .);
+ }
+
+--
+1.7.6.5 \ No newline at end of file