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: More i386 architectures?


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;



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