+2017-07-03 Alan Modra <amodra@gmail.com>
+
+ * 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.
+
2017-07-03 Alan Modra <amodra@gmail.com>
* elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
if (sizeof (bfd_vma) <= sizeof (unsigned long))
return strtoul (string, (char **) end, base);
-#ifdef HAVE_STRTOULL
+#if defined (HAVE_STRTOULL) && defined (HAVE_LONG_LONG)
if (sizeof (bfd_vma) <= sizeof (unsigned long long))
return strtoull (string, (char **) end, base);
#endif
}
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) \
case 4:
{
- long long x = bfd_get_64 (abfd, addr);
+ bfd_uint64_t x = bfd_get_64 (abfd, addr);
DOIT (x);
- bfd_put_64 (abfd, (bfd_vma) x, addr);
+ bfd_put_64 (abfd, x, addr);
}
break;
if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) != XTY_LD)
{
BFD_ASSERT (! aux->fix_scnlen);
-#ifdef XCOFF64
- fprintf (file, "val %5lld",
- (long long) aux->u.auxent.x_csect.x_scnlen.l);
-#else
- fprintf (file, "val %5ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
-#endif
+ fprintf (file, "val %5" BFD_VMA_FMT "d",
+ aux->u.auxent.x_csect.x_scnlen.l);
}
else
{
fprintf (file, "indx ");
if (! aux->fix_scnlen)
-#ifdef XCOFF64
- fprintf (file, "%4lld",
- (long long) aux->u.auxent.x_csect.x_scnlen.l);
-#else
- fprintf (file, "%4ld", (long) aux->u.auxent.x_csect.x_scnlen.l);
-#endif
+ fprintf (file, "%4" BFD_VMA_FMT "d",
+ aux->u.auxent.x_csect.x_scnlen.l);
else
fprintf (file, "%4ld",
(long) (aux->u.auxent.x_csect.x_scnlen.p - table_base));
score3_bfd_getl48 (const void *p)
{
const bfd_byte *addr = p;
- unsigned long long v;
-
- v = (unsigned long long) addr[4];
- v |= (unsigned long long) addr[5] << 8;
- v |= (unsigned long long) addr[2] << 16;
- v |= (unsigned long long) addr[3] << 24;
- v |= (unsigned long long) addr[0] << 32;
- v |= (unsigned long long) addr[1] << 40;
+ bfd_uint64_t v;
+
+ v = (bfd_uint64_t) addr[4];
+ v |= (bfd_uint64_t) addr[5] << 8;
+ v |= (bfd_uint64_t) addr[2] << 16;
+ v |= (bfd_uint64_t) addr[3] << 24;
+ v |= (bfd_uint64_t) addr[0] << 32;
+ v |= (bfd_uint64_t) addr[1] << 40;
return v;
}
struct vms_eisd *eisd;
unsigned int rec_size;
unsigned int size;
- unsigned long long vaddr;
+ bfd_uint64_t vaddr;
unsigned int flags;
unsigned int vbn;
char *name = NULL;