summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils-2.17/ld
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-03-20 12:51:22 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-03-20 12:51:22 +0000
commit4ef93920abe1a3b094bab4dd98c730b3484bcb73 (patch)
tree37c6ef0c8ac6fa07485b9be4f5e8bb0b89c47646 /gnu/usr.bin/binutils-2.17/ld
parent5ae58553755850a3b6d0e43b35ab01f15fc94bad (diff)
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@
Diffstat (limited to 'gnu/usr.bin/binutils-2.17/ld')
-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)) }