loader: Add linker scripts for gold v2.22
authorJohn Marino <draco@marino.st>
Fri, 24 Feb 2012 17:33:50 +0000 (18:33 +0100)
committerJohn Marino <draco@marino.st>
Fri, 24 Feb 2012 23:45:21 +0000 (00:45 +0100)
commit208fbaaf29ac0c3a2b0fb28ac3d4e500899b3646
treec63e90d6569bda9522cb2433650fbf8984f8ae12
parent3fd0a84aa59533ebe90529e3d013e49fc04f35e1
loader: Add linker scripts for gold v2.22

The program header handling defaults for the gold linker that comes with
binutils 2.22 changed from the 2.21 version.  As a result, DragonFly's
loader broke when linked with gold, rendering it unbootable.

The solution is to provide dedicated linker scripts for btx, btxldr, and
the loader itself.  These scripts specify how to handle the program
headers.  In these cases, we don't want to embed the headers in the first
LOAD segment which is what gold was doing, so the PDHRS section of the
scripts prevents that from happening.

The gnu ld-built loader still builds just fine with these linker scripts.
sys/boot/pc32/btx/btx/Makefile
sys/boot/pc32/btx/btx/btx.ldscript [new file with mode: 0644]
sys/boot/pc32/btx/btxldr/Makefile
sys/boot/pc32/btx/btxldr/btxldr.ldscript [new file with mode: 0644]
sys/boot/pc32/loader/Makefile
sys/boot/pc32/loader/loader.ldscript [new file with mode: 0644]
sys/boot/pc32/loader_tftp/Makefile