More i386 architectures?

Alan Modra amodra@bigpond.net.au
Thu Nov 15 04:48:00 GMT 2001


On Wed, Nov 28, 2001 at 02:58:43PM -0500, Andrew Cagney wrote:
> 
> > Here is a first pass at implementing an architecture note for x86, and
> > a bug-fix for obj-elf.c I noticed.
> 
> This ...
> >  i_note.descsz = 0;	/* no description */
> >        i_note.type = NT_VERSION;
> >        p = frag_more (sizeof (e_note.namesz));
> > -      md_number_to_chars (p, (valueT) i_note.namesz, 4);
> > +      md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz));
> 
> Careful.
> 
> My ELF book says that namesz is 4 bytes.  I'd assume that the original 
> author wrote ``...namesz, 4)'' so that it explicitly matched the spec 
> and not a host dependant sizeof(unsigned long).

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;




More information about the Binutils mailing list