History log of /openbsd-current/gnu/usr.bin/binutils-2.17/ld/scripttempl/elf.sc
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.12 03-Dec-2018 guenther

Merge post-2.17 but pre-GPLv3 diffs that add support for DT_GNU_HASH
to ld and improve the readelf support:
https://sourceware.org/ml/binutils/2006-07/msg00129.html
https://sourceware.org/ml/binutils/2006-07/msg00181.html

Disable the ld support on mips64, as its ABI requires a symbol
ordering that conflicts with the requirements of DT_GNU_HASH.

Tested on macppc, alpha, and sparc64 to verify operation with all
three ELF word size combos

testing help miod@
ok kettenis@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.11 01-Jul-2017 deraadt

provide both TRAP and NOP values for our architectures, then change
elf.sc to FILL .text segment with TRAP. .init/.fini remain NOP FILL.

It is possible that some of these TRAP values aren't perfect yet, but
they can be changed. When doing so also change the ld.script and gap.o
TRAP value.

discussions with mortimer, ok kettenis


Revision tags: OPENBSD_6_1_BASE
# 1.10 14-Aug-2016 guenther

Turning off relro shouldn't insert padding into the middle of the relro
section; remove the PAD_GOT0 use that I should have deleted before. This
caused ld.so crashes on arm when building binutils.

critical debugging observations by kettenis@


# 1.9 10-Aug-2016 guenther

Cover your kid's remaining eye and lock up the pets for the great old ones
have been disturbed: rework the linker script and then enable RELRO support
on all but mips64 (something something padding) and m88k (untested).
This extends the RO coverage from just .got and .cdtors to also include
.openbsd.randomdata, .jcr, .dynamic, and .data.rel.ro., and moves more
segments from the text section to the rodata section. Depends on the
previous csu and ld.so work; reinstall those *before* rebuilding ld, or
just get a snapshot.

clues from kettenis
assistance testing and ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.8 09-Aug-2014 guenther

We don't use the __openbsd_randomdata_{start,end} symbols, but rather
get that info via the PT_OPENBSD_RANDOM segment info, so kill the symbols
While here, delete the commented out lines for __DYNAMIC as the question
they ask is answered 'no'

ok matthew@ back in May


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.7 24-Mar-2013 miod

Don't forget to put .plt padding in the BSS_PLT case; lost during the 2.15->2.17
update.


# 1.6 21-Mar-2013 miod

Don't set TEXT_PLT if PLT_BEFORE_GOT.


# 1.5 20-Mar-2013 guenther

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@


# 1.4 18-Mar-2013 miod

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.


# 1.3 09-Mar-2013 miod

Bring back got and plt padding sections and special symbols from our changes
to binutils 2.15. Do not preserve brain cells. Do not collect $20,000.
Do not pass go. Do not keep your sanity.


Revision tags: OPENBSD_5_3_BASE
# 1.2 20-Aug-2012 matthew

Add support for .openbsd.randomdata and PT_OPENBSD_RANDOMIZE to
binutils 2.17. Passes randomdata regress tests on sparc64.


# 1.1 24-Apr-2011 miod

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_2_BASE
# 1.11 01-Jul-2017 deraadt

provide both TRAP and NOP values for our architectures, then change
elf.sc to FILL .text segment with TRAP. .init/.fini remain NOP FILL.

It is possible that some of these TRAP values aren't perfect yet, but
they can be changed. When doing so also change the ld.script and gap.o
TRAP value.

discussions with mortimer, ok kettenis


Revision tags: OPENBSD_6_1_BASE
# 1.10 14-Aug-2016 guenther

Turning off relro shouldn't insert padding into the middle of the relro
section; remove the PAD_GOT0 use that I should have deleted before. This
caused ld.so crashes on arm when building binutils.

critical debugging observations by kettenis@


# 1.9 10-Aug-2016 guenther

Cover your kid's remaining eye and lock up the pets for the great old ones
have been disturbed: rework the linker script and then enable RELRO support
on all but mips64 (something something padding) and m88k (untested).
This extends the RO coverage from just .got and .cdtors to also include
.openbsd.randomdata, .jcr, .dynamic, and .data.rel.ro., and moves more
segments from the text section to the rodata section. Depends on the
previous csu and ld.so work; reinstall those *before* rebuilding ld, or
just get a snapshot.

clues from kettenis
assistance testing and ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.8 09-Aug-2014 guenther

We don't use the __openbsd_randomdata_{start,end} symbols, but rather
get that info via the PT_OPENBSD_RANDOM segment info, so kill the symbols
While here, delete the commented out lines for __DYNAMIC as the question
they ask is answered 'no'

ok matthew@ back in May


Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.7 24-Mar-2013 miod

Don't forget to put .plt padding in the BSS_PLT case; lost during the 2.15->2.17
update.


# 1.6 21-Mar-2013 miod

Don't set TEXT_PLT if PLT_BEFORE_GOT.


# 1.5 20-Mar-2013 guenther

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@


# 1.4 18-Mar-2013 miod

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.


# 1.3 09-Mar-2013 miod

Bring back got and plt padding sections and special symbols from our changes
to binutils 2.15. Do not preserve brain cells. Do not collect $20,000.
Do not pass go. Do not keep your sanity.


Revision tags: OPENBSD_5_3_BASE
# 1.2 20-Aug-2012 matthew

Add support for .openbsd.randomdata and PT_OPENBSD_RANDOMIZE to
binutils 2.17. Passes randomdata regress tests on sparc64.


# 1.1 24-Apr-2011 miod

branches: 1.1.1;
Initial revision