diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-04 12:22:39 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-04 12:22:39 +0930 |
commit | b82817674f46e4f08a5910719499ddc72399473f (patch) | |
tree | 079452a4c6a71ffe6493a8a818007700dad6c7e5 /bfd/elf32-rx.c | |
parent | 6b9bd54c24dcf08e400e5b79a958e051ccfde30d (diff) | |
download | gdb-b82817674f46e4f08a5910719499ddc72399473f.zip gdb-b82817674f46e4f08a5910719499ddc72399473f.tar.gz gdb-b82817674f46e4f08a5910719499ddc72399473f.tar.bz2 |
Don't use BFD_VMA_FMT in binutils
BFD_VMA_FMT can't be used in format strings that need to be
translated, because the translation won't work when the type of
bfd_vma differs from the machine used to compile .pot files. We've
known about this for a long time, but patches slip through review.
So just get rid of BFD_VMA_FMT, instead using the appropriate PRId64,
PRIu64, PRIx64 or PRIo64 and SCN variants for scanf. The patch is
mostly mechanical, the only thing requiring any thought is casts
needed to preserve PRId64 output from bfd_vma values, or to preserve
one of the unsigned output formats from bfd_signed_vma values.
Diffstat (limited to 'bfd/elf32-rx.c')
-rw-r--r-- | bfd/elf32-rx.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index 6df0214..34eb884 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -3972,16 +3972,17 @@ rx_table_map (struct bfd_hash_entry *vent, void *vinfo) bfd_hash_traverse (&(info->info->hash->table), rx_table_map_2, info); - fprintf (info->mapfile, "\nRX Vector Table: %s has %d entries at 0x%08" BFD_VMA_FMT "x\n\n", - tname, info->table_size, start_addr); + fprintf (info->mapfile, + "\nRX Vector Table: %s has %d entries at 0x%08" PRIx64 "\n\n", + tname, info->table_size, (uint64_t) start_addr); if (info->table_default_entry) - fprintf (info->mapfile, " default handler is: %s at 0x%08" BFD_VMA_FMT "x\n", + fprintf (info->mapfile, " default handler is: %s at 0x%08" PRIx64 "\n", info->table_default_entry->root.string, - info->table_default_handler); + (uint64_t) info->table_default_handler); else if (info->table_default_handler != (bfd_vma)(-1)) - fprintf (info->mapfile, " default handler is at 0x%08" BFD_VMA_FMT "x\n", - info->table_default_handler); + fprintf (info->mapfile, " default handler is at 0x%08" PRIx64 "\n", + (uint64_t) info->table_default_handler); else fprintf (info->mapfile, " no default handler\n"); @@ -3997,7 +3998,8 @@ rx_table_map (struct bfd_hash_entry *vent, void *vinfo) } need_elipses = 1; - fprintf (info->mapfile, " 0x%08" BFD_VMA_FMT "x [%3d] ", start_addr + 4 * idx, idx); + fprintf (info->mapfile, + " 0x%08" PRIx64 " [%3d] ", (uint64_t) start_addr + 4 * idx, idx); if (info->table_handlers[idx] == (bfd_vma) (-1)) fprintf (info->mapfile, "(no handler found)\n"); @@ -4012,12 +4014,15 @@ rx_table_map (struct bfd_hash_entry *vent, void *vinfo) else if (info->table_entries[idx]) { - fprintf (info->mapfile, "0x%08" BFD_VMA_FMT "x %s\n", info->table_handlers[idx], info->table_entries[idx]->root.string); + fprintf (info->mapfile, "0x%08" PRIx64 " %s\n", + (uint64_t) info->table_handlers[idx], + info->table_entries[idx]->root.string); } else { - fprintf (info->mapfile, "0x%08" BFD_VMA_FMT "x ???\n", info->table_handlers[idx]); + fprintf (info->mapfile, "0x%08" PRIx64 " ???\n", + (uint64_t) info->table_handlers[idx]); } } if (need_elipses) |