From ffa5352c0c0f735541e69fe6d9a192d82e7d418c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 7 Jul 2021 10:25:41 +0100 Subject: Fix problems translating messages when a percentage sign appears at the end of a string. PR 28051 gas * config/tc-i386.c (offset_in_range): Reformat error messages in order to fix problems when translating. (md_assemble): Likewise. * messages.c (as_internal_value_out_of_range): Likewise. * read.c (emit_expr_with_reloc): Likewise. * testsuite/gas/all/overflow.l Change expected output format. * po/gas.pot: Regenerate. bfd * coff-rs6000.c (xcoff_reloc_type_tls): Reformat error messages in order to fix problems when translating. * cofflink.c (_bfd_coff_write_global_sym): Likewise. * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub): Likewise. * po/bfd.pot: Regenerate. --- gas/read.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gas/read.c') diff --git a/gas/read.c b/gas/read.c index 935b1fa..ea9261e 100644 --- a/gas/read.c +++ b/gas/read.c @@ -4546,9 +4546,14 @@ emit_expr_with_reloc (expressionS *exp, use = get & unmask; if ((get & mask) != 0 && (-get & mask) != 0) { + char get_buf[128]; + char use_buf[128]; + + /* These buffers help to ease the translation of the warning message. */ + sprintf_vma (get_buf, get); + sprintf_vma (use_buf, use); /* Leading bits contain both 0s & 1s. */ - as_warn (_("value 0x%" BFD_VMA_FMT "x truncated to 0x%" BFD_VMA_FMT "x"), - get, use); + as_warn (_("value 0x%s truncated to 0x%s"), get_buf, use_buf); } /* Put bytes in right order. */ md_number_to_chars (p, use, (int) nbytes); -- cgit v1.1