This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] initial i386-nacl target support for gas
On Fri, Jan 20, 2012 at 5:28 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> LInker should pad to section alignment properly. If it doesn't
> do that, please open a linker bug with a testcase. Your
> assembler workaround may not cover all cases.
I happened to be sitting next to Ian on Friday and he pointed out the case
where assembly-time alignment padding is not sufficient. When a section
with a greater alignment requirement follows a section with a lesser
requirement, then only the linker can know that additional padding is
required. When those sections are executable (or probably, even when only
the first section is), then the linker should use nops for the padding.
I filed these two bugs:
http://sourceware.org/bugzilla/show_bug.cgi?id=13616
http://sourceware.org/bugzilla/show_bug.cgi?id=13617
The second one is for gold, which already almost gets this right.
But it emits a "jump around the gap" in lieu of a long stretch of nops,
and fills the gap with zeros instead of more nop instructions, which is
not good enough.
Thanks,
Roland