aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-19 18:19:38 +0930
committerAlan Modra <amodra@gmail.com>2020-08-19 21:25:47 +0930
commitd1ce973eb377f19240005665258ce1d89bd064b5 (patch)
tree63c22a967d6bb294196b6b4bd81d605b1a34a39f
parent9327494e0eeb118727446412a7fce2c0616a6788 (diff)
downloadgdb-d1ce973eb377f19240005665258ce1d89bd064b5.zip
gdb-d1ce973eb377f19240005665258ce1d89bd064b5.tar.gz
gdb-d1ce973eb377f19240005665258ce1d89bd064b5.tar.bz2
PR26349, FAIL: binutils-all/pr25543 on hpux
The 't' length modifier isn't in SUSv2, unsurprisingly %tx isn't recognized by older printf implementations. So even though 't' is correct for ptrdiff_t we can't use it. Also, _bfd_int64_high and _bfd_int64_low disappeared in 2008. PR 26349 * readelf.c (dump_relocations): Use BFD_VMA_FMT to print offset and info fields. (dump_section_as_strings): Don't use %tx to display offset.
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/readelf.c34
2 files changed, 10 insertions, 31 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 7a6479b..37558ef 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-19 Alan Modra <amodra@gmail.com>
+
+ PR 26349
+ * readelf.c (dump_relocations): Use BFD_VMA_FMT to print offset
+ and info fields.
+ (dump_section_as_strings): Don't use %tx to display offset.
+
2020-08-14 Alan Modra <amodra@gmail.com>
PR 26388
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 17868e2..c47a77c 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -1281,32 +1281,10 @@ dump_relocations (Filedata * filedata,
}
else
{
-#if BFD_HOST_64BIT_LONG
printf (do_wide
- ? "%16.16lx %16.16lx "
- : "%12.12lx %12.12lx ",
+ ? "%16.16" BFD_VMA_FMT "x %16.16" BFD_VMA_FMT "x "
+ : "%12.12" BFD_VMA_FMT "x %12.12" BFD_VMA_FMT "x ",
offset, inf);
-#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
- printf (do_wide
- ? "%16.16llx %16.16llx "
- : "%12.12llx %12.12llx ",
- offset, inf);
-#else
- printf (do_wide
- ? "%16.16I64x %16.16I64x "
- : "%12.12I64x %12.12I64x ",
- offset, inf);
-#endif
-#else
- printf (do_wide
- ? "%8.8lx%8.8lx %8.8lx%8.8lx "
- : "%4.4lx%8.8lx %4.4lx%8.8lx ",
- _bfd_int64_high (offset),
- _bfd_int64_low (offset),
- _bfd_int64_high (inf),
- _bfd_int64_low (inf));
-#endif
}
switch (filedata->file_header.e_machine)
@@ -13985,13 +13963,7 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata)
}
else
{
-#ifndef __MSVCRT__
- /* PR 11128: Use two separate invocations in order to work
- around bugs in the Solaris 8 implementation of printf. */
- printf (" [%6tx] ", data - start);
-#else
- printf (" [%6Ix] ", (size_t) (data - start));
-#endif
+ printf (" [%6lx] ", (unsigned long) (data - start));
}
if (maxlen > 0)