* readelf.c (read_leb128): Support 64bit host.
+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):
{
unsigned long int result = 0;
unsigned int num_read = 0;
- int shift = 0;
+ unsigned int shift = 0;
unsigned char byte;
do
byte = *data++;
num_read++;
- result |= (byte & 0x7f) << shift;
+ result |= ((unsigned long int) (byte & 0x7f)) << shift;
shift += 7;
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;
}