From b82817674f46e4f08a5910719499ddc72399473f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 4 Aug 2022 12:22:39 +0930 Subject: 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. --- ld/ldlang.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ld') diff --git a/ld/ldlang.c b/ld/ldlang.c index 865c28b..03daba6 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -9632,16 +9632,16 @@ lang_ld_feature (char *str) /* Pretty print memory amount. */ static void -lang_print_memory_size (bfd_vma sz) +lang_print_memory_size (uint64_t sz) { if ((sz & 0x3fffffff) == 0) - printf ("%10" BFD_VMA_FMT "u GB", sz >> 30); + printf ("%10" PRIu64 " GB", sz >> 30); else if ((sz & 0xfffff) == 0) - printf ("%10" BFD_VMA_FMT "u MB", sz >> 20); + printf ("%10" PRIu64 " MB", sz >> 20); else if ((sz & 0x3ff) == 0) - printf ("%10" BFD_VMA_FMT "u KB", sz >> 10); + printf ("%10" PRIu64 " KB", sz >> 10); else - printf (" %10" BFD_VMA_FMT "u B", sz); + printf (" %10" PRIu64 " B", sz); } /* Implement --print-memory-usage: disply per region memory usage. */ @@ -9658,7 +9658,7 @@ lang_print_memory_usage (void) printf ("%16s: ",r->name_list.name); lang_print_memory_size (used_length); - lang_print_memory_size ((bfd_vma) r->length); + lang_print_memory_size (r->length); if (r->length != 0) { -- cgit v1.1