]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blob - binutils/patches/binutils-2.23.52.0.1-hardened-crtbegin.patch
elfutils: Update to 0.166
[people/pmueller/ipfire-3.x.git] / binutils / patches / binutils-2.23.52.0.1-hardened-crtbegin.patch
1 https://bugs.gentoo.org/391899
2 https://bugs.gentoo.org/393321
3
4 Make sure the default ELF linker script does the right thing with our customer
5 PIE+PIC gcc objects (until we get a chance to rename them).
6
7 2011-12-05 Magnus Granberg <zorry@gentoo.org>, Alphat-PC <AlphatPC@gmail.com>
8
9 * scripttempl/elf.sc: Add support for crtbeginTS.o
10
11 --- a/ld/scripttempl/elf.sc
12 +++ b/ld/scripttempl/elf.sc
13 @@ -225,8 +225,8 @@
14 if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then
15 SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))"
16 SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))"
17 - CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
18 - DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
19 + CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtbeginTS.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors"
20 + DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtbeginTS.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors"
21 else
22 SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))"
23 SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))"
24 @@ -264,6 +264,7 @@
25
26 KEEP (*crtbegin.o(.ctors))
27 KEEP (*crtbegin?.o(.ctors))
28 + KEEP (*crtbeginTS.o(.ctors))
29
30 /* We don't want to include the .ctor section from
31 the crtend.o file until after the sorted ctors.
32 @@ -280,6 +281,7 @@
33 ${CONSTRUCTING+${DTOR_START}}
34 KEEP (*crtbegin.o(.dtors))
35 KEEP (*crtbegin?.o(.dtors))
36 + KEEP (*crtbeginTS.o(.dtors))
37 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
38 KEEP (*(SORT(.dtors.*)))
39 KEEP (*(.dtors))