aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-09-13 14:32:11 +0000
committerAlan Modra <amodra@gmail.com>2007-09-13 14:32:11 +0000
commit39dbeff83eda4b7d3c2799e698db3c047e9d3a22 (patch)
tree125c79d21e6ab63f84609ae25c2eb7c0db9a983b
parent17b6b921e4dc4f844f946b17d4e7685c3a7018c0 (diff)
downloadfsf-binutils-gdb-39dbeff83eda4b7d3c2799e698db3c047e9d3a22.zip
fsf-binutils-gdb-39dbeff83eda4b7d3c2799e698db3c047e9d3a22.tar.gz
fsf-binutils-gdb-39dbeff83eda4b7d3c2799e698db3c047e9d3a22.tar.bz2
* nm.c (value_format_64bit, set_print_radix, print_value): Handle
BFD_HOST_64BIT_LONG_LONG. * readelf.c (print_dec_vma): Don't define if BFD_HOST_64BIT_LONG_LONG. (print_vma): Handle BFD_HOST_64BIT_LONG_LONG. (dump_relocations): Likewise. Expand _bfd_int64_low in a number of places.
-rw-r--r--binutils/ChangeLog10
-rw-r--r--binutils/nm.c10
-rw-r--r--binutils/readelf.c58
3 files changed, 50 insertions, 28 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index f3438f1..d7d5044 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,13 @@
+2007-09-13 Alan Modra <amodra@bigpond.net.au>
+ Zhou Drangon <drangon.mail@gmail.com>
+
+ * nm.c (value_format_64bit, set_print_radix, print_value): Handle
+ BFD_HOST_64BIT_LONG_LONG.
+ * readelf.c (print_dec_vma): Don't define if BFD_HOST_64BIT_LONG_LONG.
+ (print_vma): Handle BFD_HOST_64BIT_LONG_LONG.
+ (dump_relocations): Likewise. Expand _bfd_int64_low in a
+ number of places.
+
2007-09-11 Kai Tietz <kai.tietz@onevision.com>
* rcparse.y: (string_data): Removed ill token removal.
diff --git a/binutils/nm.c b/binutils/nm.c
index d5f18cd..1dbf47e 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -160,7 +160,11 @@ static int filename_per_symbol = 0; /* Once per symbol, at start of line. */
/* Print formats for printing a symbol value. */
static char value_format_32bit[] = "%08lx";
+#if BFD_HOST_64BIT_LONG
static char value_format_64bit[] = "%016lx";
+#elif BFD_HOST_64BIT_LONG_LONG
+static char value_format_64bit[] = "%016llx";
+#endif
static int print_width = 0;
static int print_radix = 16;
/* Print formats for printing stab info. */
@@ -269,7 +273,11 @@ set_print_radix (char *radix)
else
print_radix = 8;
value_format_32bit[4] = *radix;
+#if BFD_HOST_64BIT_LONG
value_format_64bit[5] = *radix;
+#elif BFD_HOST_64BIT_LONG_LONG
+ value_format_64bit[6] = *radix;
+#endif
other_format[3] = desc_format[3] = *radix;
break;
default:
@@ -1341,7 +1349,7 @@ print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val)
break;
case 64:
-#if BFD_HOST_64BIT_LONG
+#if BFD_HOST_64BIT_LONG || BFD_HOST_64BIT_LONG_LONG
printf (value_format_64bit, val);
#else
/* We have a 64 bit value to print, but the host is only 32 bit. */
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 2c74411..8bf65c7 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -383,7 +383,7 @@ byte_put_little_endian (unsigned char *field, bfd_vma value, int size)
}
}
-#if defined BFD64 && !BFD_HOST_64BIT_LONG
+#if defined BFD64 && !BFD_HOST_64BIT_LONG && !BFD_HOST_64BIT_LONG_LONG
static int
print_dec_vma (bfd_vma vma, int is_signed)
{
@@ -491,6 +491,8 @@ print_vma (bfd_vma vma, print_mode mode)
case HEX:
#if BFD_HOST_64BIT_LONG
return nc + printf ("%lx", vma);
+#elif BFD_HOST_64BIT_LONG_LONG
+ return nc + printf ("%llx", vma);
#else
return nc + print_hex_vma (vma);
#endif
@@ -498,6 +500,8 @@ print_vma (bfd_vma vma, print_mode mode)
case DEC:
#if BFD_HOST_64BIT_LONG
return printf ("%ld", vma);
+#elif BFD_HOST_64BIT_LONG_LONG
+ return printf ("%lld", vma);
#else
return print_dec_vma (vma, 1);
#endif
@@ -508,6 +512,11 @@ print_vma (bfd_vma vma, print_mode mode)
return printf ("%5ld", vma);
else
return printf ("%#lx", vma);
+#elif BFD_HOST_64BIT_LONG_LONG
+ if (vma <= 99999)
+ return printf ("%5lld", vma);
+ else
+ return printf ("%#llx", vma);
#else
if (vma <= 99999)
return printf ("%5ld", _bfd_int64_low (vma));
@@ -518,6 +527,8 @@ print_vma (bfd_vma vma, print_mode mode)
case UNSIGNED:
#if BFD_HOST_64BIT_LONG
return printf ("%lu", vma);
+#elif BFD_HOST_64BIT_LONG_LONG
+ return printf ("%llu", vma);
#else
return print_dec_vma (vma, 0);
#endif
@@ -953,15 +964,23 @@ dump_relocations (FILE *file,
if (is_32bit_elf)
{
-#ifdef _bfd_int64_low
- printf ("%8.8lx %8.8lx ", _bfd_int64_low (offset), _bfd_int64_low (info));
-#else
- printf ("%8.8lx %8.8lx ", offset, info);
-#endif
+ printf ("%8.8lx %8.8lx ",
+ (unsigned long) offset & 0xffffffff,
+ (unsigned long) info & 0xffffffff);
}
else
{
-#ifdef _bfd_int64_low
+#if BFD_HOST_64BIT_LONG
+ printf (do_wide
+ ? "%16.16lx %16.16lx "
+ : "%12.12lx %12.12lx ",
+ offset, info);
+#elif BFD_HOST_64BIT_LONG_LONG
+ printf (do_wide
+ ? "%16.16llx %16.16llx "
+ : "%12.12llx %12.12llx ",
+ offset, info);
+#else
printf (do_wide
? "%8.8lx%8.8lx %8.8lx%8.8lx "
: "%4.4lx%8.8lx %4.4lx%8.8lx ",
@@ -969,11 +988,6 @@ dump_relocations (FILE *file,
_bfd_int64_low (offset),
_bfd_int64_high (info),
_bfd_int64_low (info));
-#else
- printf (do_wide
- ? "%16.16lx %16.16lx "
- : "%12.12lx %12.12lx ",
- offset, info);
#endif
}
@@ -1203,11 +1217,7 @@ dump_relocations (FILE *file,
}
if (rtype == NULL)
-#ifdef _bfd_int64_low
- printf (_("unrecognized: %-7lx"), _bfd_int64_low (type));
-#else
- printf (_("unrecognized: %-7lx"), type);
-#endif
+ printf (_("unrecognized: %-7lx"), (unsigned long) type & 0xffffffff);
else
printf (do_wide ? "%-22.22s" : "%-17.17s", rtype);
@@ -1323,22 +1333,16 @@ dump_relocations (FILE *file,
printf (" Type2: ");
if (rtype2 == NULL)
-#ifdef _bfd_int64_low
- printf (_("unrecognized: %-7lx"), _bfd_int64_low (type2));
-#else
- printf (_("unrecognized: %-7lx"), type2);
-#endif
+ printf (_("unrecognized: %-7lx"),
+ (unsigned long) type2 & 0xffffffff);
else
printf ("%-17.17s", rtype2);
printf ("\n Type3: ");
if (rtype3 == NULL)
-#ifdef _bfd_int64_low
- printf (_("unrecognized: %-7lx"), _bfd_int64_low (type3));
-#else
- printf (_("unrecognized: %-7lx"), type3);
-#endif
+ printf (_("unrecognized: %-7lx"),
+ (unsigned long) type3 & 0xffffffff);
else
printf ("%-17.17s", rtype3);