summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils-2.17/ld
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-03-18 22:01:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-03-18 22:01:20 +0000
commita2b87b7baff81b9d3fd695eb5f0352099d6bee00 (patch)
treeb9c2c563b13c8bb3a8cc0413b9d78d36fecebf4e /gnu/usr.bin/binutils-2.17/ld
parent50e200fbd75f7b4ba6f8191cbf7e0ff7193260f7 (diff)
Try harder putting .ctor and .dtor next to .got, to be able to have ld.so
mprotect these sections RO as soon as they have been relocated; similar to what the W^X changes in 2.15 did.
Diffstat (limited to 'gnu/usr.bin/binutils-2.17/ld')
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc14
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc b/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
index 03324a20e0d..9c64ba5459d 100644
--- a/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
+++ b/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
@@ -427,9 +427,15 @@ cat <<EOF
${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
${DATA_GOT+${RELRO_NOW+${PAD_GOT+${PAD_GOT1}}}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
+ /* If PAD_CDTOR, and separate .got and .got.plt sections, CTOR and DTOR
+ are relocated here to receive the same mprotect protection as .got */
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${PAD_CDTOR+${RELOCATING+${CTOR}}}}}}
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${PAD_CDTOR+${RELOCATING+${DTOR}}}}}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${PAD_GOT+${PAD_GOT1}}}}}
${RELOCATING+${DATA_SEGMENT_RELRO_END}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${PAD_CDTOR+${RELOCATING+${CTOR}}}}}}
+ ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${PAD_CDTOR+${RELOCATING+${DTOR}}}}}}
${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${PAD_GOT+${PAD_GOT1}}}}}
${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
@@ -457,8 +463,12 @@ cat <<EOF
${SDATA_GOT+${DATA_NONEXEC_PLT+${PLT}}}
${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}}
${SDATA_GOT+${GOT}}
- ${PAD_CDTOR+${RELOCATING+${CTOR}}}
- ${PAD_CDTOR+${RELOCATING+${DTOR}}}
+
+ ${DATA_GOT+${RELRO_NOW+${PAD_CDTOR+${RELOCATING+${CTOR}}}}}
+ ${DATA_GOT+${RELRO_NOW+${PAD_CDTOR+${RELOCATING+${DTOR}}}}}
+ ${DATA_GOT-${PAD_CDTOR+${RELOCATING+${CTOR}}}}
+ ${DATA_GOT-${PAD_CDTOR+${RELOCATING+${DTOR}}}}
+
${SDATA_GOT+${OTHER_GOT_SECTIONS}}
${SDATA_GOT+${PAD_GOT+${PAD_GOT1}}}