This is the mail archive of the binutils@sources.redhat.com 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: ELF64 note sections


On Thu, Sep 18, 2003 at 05:07:18PM +0930, Alan Modra wrote:
> http://www.caldera.com/developers/gabi/latest/ch5.pheader.html#note_section
> says of note sections:
> 
>   "In 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64),
> each entry is an array of 8-byte words in the format of the target
> processor. In 32-bit objects (files with e_ident[EI_CLASS] equal to
> ELFCLASS32), each entry is an array of 4-byte words in the format of the
> target processor."
> 
> 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;
> 
> ie. there aren't Elf64_External_Note and Elf32_External_Note variants.
> 
> It appears that core dumps generated by 64-bit Linux kernels just follow
> the 32-bit layout too.  What's more, I can't see any need whatsoever for
> > 4G notes, so perhaps the gabi needs altering here.

Oh hey, while I remember....

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's not a new problem.  Take a look at Elf_External_Versym.  Then
think about what that #ifdef __GNUC__ actually might cause...


Yeah, I'm just griping, I don't have a patch.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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