[PATCH] ELF: Don't sort output note section by alignments in ascending order

H.J. Lu hjl.tools@gmail.com
Fri Oct 5 23:57:00 GMT 2018


On Fri, Oct 5, 2018 at 4:32 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Fri, Oct 05, 2018 at 05:46:04AM -0700, H.J. Lu wrote:
> > On Fri, Oct 5, 2018 at 5:37 AM Nick Clifton <nickc@redhat.com> wrote:
> > >
> > > Hi H.J.
> > >
> > > > Since we can only insert a note section after another note section,
> > >
> > > Why is this ?
> > >
> > > If the note section that we want to insert has a different alignment
> > > from the any previous note section why can't we insert it where we like ?
> >
> > lang_insert_orphan calls insert_os_after to place a note section output
> > statement.  Since it needs an existing output statement to insert after,
> > there is no way to place a section BEFORE a note output statement
> > if it is the first output statement.
>
> The first output section statement is the one created in lang_init,
> the dummy abs_output_section.  Any output section statement for a note
> section is *not* the first on the list.

I couldn't find a way to place a note section after the dummy
abs_output_section.
The testcase is

https://sourceware.org/bugzilla/show_bug.cgi?id=23658#c6

When building a shared object, there is no .interp section after which we
can place a note section before .note.gnu.build-id section.


-- 
H.J.



More information about the Binutils mailing list