ELF64 note sections

Geoff Keating geoffk@geoffk.org
Thu Sep 18 14:54:00 GMT 2003


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)).

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Binutils mailing list