gold patch committed (Was: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel)
Ian Lance Taylor
iant@google.com
Fri Apr 23 14:12:00 GMT 2010
"H.J. Lu" <hjl.tools@gmail.com> writes:
> It can get quite complicated. What if there is an input with
>
> ---
> .text
> .p2align 23
> foo:
> nop
> ---
>
> I think the best linker can do is to issue an error.
As far as I know that case is already handled just fine. The
assembler should put the required alignment in the sh_align field of
the section header. The linker should honor that alignment when
setting the section address, and should also copy the alignment into
the p_align field of the program header.
The case I just changed was where the alignment was not reflected in
any sh_align field, but was only due to use of ALIGN in a linker
script.
What do you think will go wrong with the above? Is your concern that
the operating system will not be able to align the physical memory
address as required by the program header alignment? I don't see why
that would matter on a virtual memory system.
Ian
More information about the Binutils
mailing list