summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-03-20 12:51:21 +0000
committerguenther <guenther@openbsd.org>2013-03-20 12:51:21 +0000
commit05ee7c54855a667fcae552bac58ece32f62f73d6 (patch)
tree07437e99c6bd1e0dbfb9eab4332ac56a8ec5220d
parentBackout some changes introduced in linux 3.8.3 which are known (diff)
downloadwireguard-openbsd-05ee7c54855a667fcae552bac58ece32f62f73d6.tar.xz
wireguard-openbsd-05ee7c54855a667fcae552bac58ece32f62f73d6.zip
Move the __openbsd_randomdata_{start,end} symbols outside of the
.openbsd.randomdata so that ld can cleanly suppress the program header slot for PT_OPENBSD_RANDOMIZE when it isn't needed...such as for /boot. The symbols probably can and should be removed completely, but until that can be tested this at least unblocks the 2.17 transition ok miod@ matthew@
-rw-r--r--gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc8
1 files changed, 6 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 9c64ba5459d..3e0a775de59 100644
--- a/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
+++ b/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
@@ -408,12 +408,16 @@ cat <<EOF
KEEP (*(SORT(.fini_array.*)))
${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}}
}
+ /* If the randomdata_{start,end} symbols are inside the block then ld
+ always reserves a program header slot for a PT_OPENBSD_RANDOMIZE entry,
+ which for /boot shifts the address biosboot has to use even though
+ the slot isn't actually used */
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__openbsd_randomdata_start = .);}}
.openbsd.randomdata ${RELOCATING-0} :
{
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__openbsd_randomdata_start = .);}}
*(.openbsd.randomdata${RELOCATING+ .openbsd.randomdata.*})
- ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__openbsd_randomdata_end = .);}}
}
+ ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__openbsd_randomdata_end = .);}}
${PAD_CDTOR-${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}}
${PAD_CDTOR-${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}}
.jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }