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: Three more days left before the 2.30 release...


On Fri, 2018-01-26 at 15:46 +0000, Nick Clifton wrote:
> > > Could you take a look at the bug and proposed fix for
> > > https://sourceware.org/bugzilla/show_bug.cgi?id=22749
> > > "Bad alignment and padding of .note.gnu.property"
> > > 
> > > This breaks existing code that depends on the normal way GNU ELF notes
> > Currently only .note.gnu.property section follows the gABI.  Since they
> > are placed in a separate note section/segment which contains only
> > one such note,  it shouldn't be an issue since you don't need to use
> > alignment to check the next note.  I believe these tools should be
> > updated to follow gABI without breaking backward compatibility
> > like what we did in binutils and glibc.
> 
> Mark - can you confirm/deny this.  If there is only one note in the section
> does the section alignment matter ?

It doesn't follow gABI, since with ELFCLASS64 it uses 8-byte alignment
and padding between the name/data, but 4-byte values for the sizes.
Which is neither normal GNU ELF note layout, nor gabi ELF note layout.
I believe binutils ld will not merge ELF NOTE sections or segments that
have different alignments now. But other tools might try to do that
since normal GNU ELF notes all use the same alignment (some might not
even have the alignment set), so they won't know they cannot. The
problem is that even if the notes might be in separate sections or
segments that code will assume it can read them all and seeing bogus
data in one they will most likely stop processing any others.

I appreciate that H.J. is fixing up various tools to follow this new
layout. But this feels like a loosing game of whack-a-mole. There is no
reason to not use the normal GNU ELF note layout (which is also used by
others). And inventing something new that isn't GNU and isn't really
gabi after all these years is just asking for trouble.

Cheers,

Mark


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