RFA: Add readelf --unwind support for ARM

Nick Clifton nickc@redhat.com
Tue Mar 2 08:01:00 GMT 2010


Hi Daniel,

   A few comments on the patch:

 > +/* Read an unsigned LEB128 encoded value from p.  Set *PLEN to the
 > number of
 > +   bytes read.  */
 > +
 > +static unsigned int
 > +read_uleb128 (unsigned char * p, unsigned int * plen)

This function is duplicated in binutils/dwarf.c.  I think that it would 
be better to just export it from there, rather than continuing with a 
second implementation in readelf.c.


 > +  if (elf_header.e_machine == EM_ARM)
 > +    addr.offset &= ~1;

I suspect that this behaviour might be needed for other architectures as 
well (MIPS16 maybe ?).  So you might as well use a macro that tests 
e_machine and returns an unmangled offset.


> +  int wrapped;

If you are using a variable as a boolean quantity then it is better to 
declare it as a bfd_boolean and use the TRUE/FALSE macros as its values.


> +	  if (relsec->sh_type == SHT_REL)

Just curious - are there any ARM binaries that use REL relocations and 
have unwind tables ?


But apart from those few minor niggles the patch looks good to me. 
Approved for installation into the mainline.

Cheers
   Nick



More information about the Binutils mailing list