This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ELF64 note sections
On Thu, Sep 18, 2003 at 07:53:42AM -0700, Geoff Keating wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
>
> > On Thu, Sep 18, 2003 at 05:07:18PM +0930, Alan Modra wrote:
> > > However, include/elf/external.h just defines:
> > > /* Note segments */
> > >
> > > typedef struct {
> > > unsigned char namesz[4]; /* Size of entry's owner string */
> > > unsigned char descsz[4]; /* Size of the note descriptor */
> > > unsigned char type[4]; /* Interpretation of the descriptor */
> > > char name[1]; /* Start of the name+desc data */
> > > } Elf_External_Note;
>
> > That struct is bogus. BFD code assumes that sizeof (Elf_External_Note)
> > is 13, but I've encountered at least one ABI which pads it up to 16
> > bytes.
>
> It should be easy enough to add __attribute__((packed)).
Which will have the same problem the other use of
__attribute__((packed)) in that file has: binutils will silently
generate incorrect output when built with a non-GNU compiler.
Is that acceptable? I don't think so.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer