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: PATCH: Fix empty sections with alignment


On Mon, Sep 26, 2005 at 03:36:01PM -0700, H. J. Lu wrote:
> This patch
> 
> http://sourceware.org/ml/binutils/2005-09/msg00215.html
> 
> breaks empty sections with alignment. The patch here works for me.

It would be nice if you explained what was broken rather than leaving me
to deduce that from your patch.  In this case it's simple, but sometimes
I'm not clever enough to immediately deduce what you think is broken.

Before I OK this patch:  Do you know whether any linker scripts depend
on an address expression consisting of an ALIGN() being ignored like
this?  Besides those distributed with binutils, or prerelease linux
kernels, I mean.  The reason I ask is that I'm not really happy with the
direction this patch is leading.  We shouldn't be treating an ALIGN()
specially.  After all, ALIGN(x) as an address is supposed to be
eqivalent to ((.+x-1)/x)*x, and people could reasonably expect that both
expressions behave the same.  Which they won't after your patch.

Instead, I think we need some linker script construct that allows us to
increase the alignment of an output section over that specified by its
input sections, other than using ALIGN() as the address.  Perhaps an
ALIGN() after the semicolon.  lang_enter_output_section_statement
already supports an output section alignment.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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