This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Fix empty sections with alignment
On Tue, Sep 27, 2005 at 12:03:15PM +0930, Alan Modra wrote:
> 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
Yes, I do. That is how I noticed it. I am working for a sharable memory
project for clusters where the output sharable memory section should be
page aligned.
> 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.
I will look into it.
H.J.