This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold-linked dragonfly kernel unbootable, likely due to segment page size, alignment
- From: John Marino <binutils at marino dot st>
- To: binutils at sourceware dot org
- Date: Sun, 19 Feb 2012 18:05:34 +0100
- Subject: gold-linked dragonfly kernel unbootable, likely due to segment page size, alignment
I have spent a few hours tweaking linker scripts to attempt to link a
DragonFly BSD kernel that boots, but so far in vain.
I have attached readelf output for kernels built with gnu ld and gold to
list the program headers, along with the version of the linker script
I've been using.
This is the x86_64 platform, so the LOAD segment alignment of 0x200000
is what we want, but gold stubbornly uses 0x1000 over 3 segments versus
the desired 0x200000 over 2 segments.
I have:
1) Tried building gold with a max-page-size of 0x200000 hardcoded in
x86_64.cc
2) Tried -z max-page-size=0x200000
3) Tried setting DATA_SEGMENT_ALIGN (0x200000, 0x200000) in the linker
script
So far nothing has made any difference at all. At first glance, it
appears the linkers interpret differently what the minimum page size
should be.
The other information which may be important is that the first LOAD
segment of the gold-built kernel has flags of "R" whereas the ld-built
first LOAD segment has flags of "R E".
I'm pretty sure the only reason the gold-linked kernel won't load is due
to size and alignment of the LOAD SEGMENTS. What setting can be used to
force gold to create two 0x200000 segments like ld does?
John
Attachment:
ldscript.x86_64.txt
Description: Text document
Attachment:
dfly64.segments.gold.txt
Description: Text document
Attachment:
dfly64.segments.ld.txt
Description: Text document