This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]