[RFC patch]: Adjust the use of 'long' type in dwarf2.h header
H.J. Lu
hjl.tools@gmail.com
Thu Feb 24 13:50:00 GMT 2011
On Thu, Feb 24, 2011 at 3:33 AM, Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr> wrote:
>> #if __GNUC__ >= 2
>> /* Define BFD64 here, even if our default architecture is 32 bit ELF
>> as this will allow us to read in and parse 64bit and 32bit ELF
>> files.
>> Only do this if we believe that the compiler can support a 64 bit
>> data type. For now we only rely on GCC being able to do this. */
>> #define BFD64
>> #endif
>>
>> ....
>> #include "dwarf.h"
>> ---
>>
>> dwarf_vma should be the same inside and outside of readelf.c.
>
>
> This means, if I understand this correctly that
> if I compile a 32 bit readelf executable
> bfd_vma will be a 64-bit integer inside readelf.c,
> but a 32-bit integer in dwarf.c.
>
> dwarf.c still mainly uses bfd_vma
> and has dwarf_vma only for one function
> get_encoded_value...
>
> Should read_leb128 (and maybe other functions within
> dwarf.c) also be changed to use
> dwarf_vma rather than bfd_vma in that case?
>
Probably since readelf.c has
static unsigned long
read_uleb128 (unsigned char *data, unsigned int *length_return)
{
return read_leb128 (data, length_return, 0);
}
--
H.J.
More information about the Binutils
mailing list