gold patch committed (Was: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel)

John Reiser jreiser@bitwagon.com
Fri Apr 23 15:55:00 GMT 2010


On 04/23/2010 08:30 AM, H.J. Lu wrote:
> You can't load the first segment with 0x1000 alignment. You
> need to load the first segment with the alignment of the second
> segment. Why does gold have to make life harder for loader?

Each PT_LOAD is a *segment* with separate attributes.  There is
no guarantee that a single read() or mmap() can necessarily handle
more than one PT_LOAD at a time, although it does work in many cases.
Both execve() and dlopen() iterate over ElfXX_Phdr, processing each
PT_LOAD separately.  A boot loader must do likewise.  For instance
ELF makes no guarantee that the PT_LOAD are in ascending order by
.p_vaddr or .p_paddr.

-- 



More information about the Binutils mailing list