aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-rs6000.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-07-03 21:59:30 +0930
committerAlan Modra <amodra@gmail.com>2017-07-03 22:03:48 +0930
commitce9116fdbfba8926a7bc25613d39bc3b2ed942fc (patch)
tree78a13ca90ae15c14c35ee77807cde3ba98363f8d /bfd/coff-rs6000.c
parentcd9af601e60240bb38dc58ce7e69abd5f2972ec7 (diff)
downloadgdb-ce9116fdbfba8926a7bc25613d39bc3b2ed942fc.zip
gdb-ce9116fdbfba8926a7bc25613d39bc3b2ed942fc.tar.gz
gdb-ce9116fdbfba8926a7bc25613d39bc3b2ed942fc.tar.bz2
BFD long long cleanup
long long isn't supposed to be used without a configure test, to support ancient compilers. Probably not terribly important nowadays. * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG. * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and Microsoft C library variant of long long format specifier. (PRINT20): Cast value to bfd_uint64_t not long long. * coffcode.h (coff_print_aux): Use BFD_VMA_FMT. * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than long long. Don't cast to bfd_vma. * elf32-score.c (score3_bfd_getl48): Likewise. * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
Diffstat (limited to 'bfd/coff-rs6000.c')
-rw-r--r--bfd/coff-rs6000.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index fabf971..3c5042f 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1715,12 +1715,18 @@ xcoff_write_armap_old (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED,
}
static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1];
+#if BFD_HOST_64BIT_LONG
+#define FMT20 "%-20ld"
+#elif defined (__MSVCRT__)
+#define FMT20 "%-20I64d"
+#else
#define FMT20 "%-20lld"
+#endif
#define FMT12 "%-12d"
#define FMT12_OCTAL "%-12o"
#define FMT4 "%-4d"
#define PRINT20(d, v) \
- sprintf (buff20, FMT20, (long long)(v)), \
+ sprintf (buff20, FMT20, (bfd_uint64_t)(v)), \
memcpy ((void *) (d), buff20, 20)
#define PRINT12(d, v) \