From 66cfc0fd0d9daadc2dac5a783b69b4050c0b1722 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 26 Sep 2017 11:28:04 +0930 Subject: PR21732, String-concatenated message can not be translated Preprocessor tokens like DWARF_VMA_FMT and BFD_VMA_FMT are not understood by gettext, and cause the translation string to be truncated. Even if it were not truncated, we wouldn't want a value that changes depending on host or configure options to be put in a translation string. PR 21732 * dwarf.c (READ_ULEB): Don't use DWARF_VMA_FMT in translated string. (READ_SLEB): Likewise. * readelf.c (bfd_vmatoa): New function. (get_data, get_dynamic_data): Use it for printing error messages. --- binutils/dwarf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'binutils/dwarf.c') diff --git a/binutils/dwarf.c b/binutils/dwarf.c index af8732b..d4156e4 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -353,8 +353,9 @@ read_uleb128 (unsigned char * data, \ (var) = _val = read_uleb128 (start, &length_return, end); \ if ((var) != _val) \ - error (_("Internal error: %s%d: LEB value (%#" DWARF_VMA_FMT "x) too large for containing variable\n"), \ - __FILE__, __LINE__, _val); \ + error (_("Internal error: %s:%d: LEB value (%s) " \ + "too large for containing variable\n"), \ + __FILE__, __LINE__, dwarf_vmatoa ("u", _val)); \ start += length_return; \ } \ while (0) @@ -366,8 +367,9 @@ read_uleb128 (unsigned char * data, \ (var) = _val = read_sleb128 (start, &length_return, end); \ if ((var) != _val) \ - error (_("Internal error: %s%d: LEB value (%#" DWARF_VMA_FMT "x) too large for containing variable\n"), \ - __FILE__, __LINE__, _val); \ + error (_("Internal error: %s:%d: LEB value (%s) " \ + "too large for containing variable\n"), \ + __FILE__, __LINE__, dwarf_vmatoa ("d", _val)); \ start += length_return; \ } \ while (0) -- cgit v1.1