2004-12-27 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (read_leb128): Support 64bit host.
This commit is contained in:
parent
e0eee039ce
commit
0c548fce69
|
@ -1,3 +1,7 @@
|
|||
2004-12-27 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* readelf.c (read_leb128): Support 64bit host.
|
||||
|
||||
2004-12-22 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* readelf.c (last_pointer_size, warned_about_missing_comp_units):
|
||||
|
|
|
@ -6933,7 +6933,7 @@ read_leb128 (unsigned char *data, int *length_return, int sign)
|
|||
{
|
||||
unsigned long int result = 0;
|
||||
unsigned int num_read = 0;
|
||||
int shift = 0;
|
||||
unsigned int shift = 0;
|
||||
unsigned char byte;
|
||||
|
||||
do
|
||||
|
@ -6941,7 +6941,7 @@ read_leb128 (unsigned char *data, int *length_return, int sign)
|
|||
byte = *data++;
|
||||
num_read++;
|
||||
|
||||
result |= (byte & 0x7f) << shift;
|
||||
result |= ((unsigned long int) (byte & 0x7f)) << shift;
|
||||
|
||||
shift += 7;
|
||||
|
||||
|
@ -6951,8 +6951,8 @@ read_leb128 (unsigned char *data, int *length_return, int sign)
|
|||
if (length_return != NULL)
|
||||
*length_return = num_read;
|
||||
|
||||
if (sign && (shift < 32) && (byte & 0x40))
|
||||
result |= -1 << shift;
|
||||
if (sign && (shift < 8 * sizeof (result)) && (byte & 0x40))
|
||||
result |= -1L << shift;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue