From e8817f20b9847bdf923c6bf7d857e09875397516 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 30 Oct 2014 09:56:52 +0000 Subject: [PATCH] Fix error message strings so that they can be translated properly. * readelf.c (CHECK_ENTSIZE_VALUES): Rewrite error message so that there is a single string for translation. (dynamic_section_mips_val): Likewise. --- binutils/ChangeLog | 12 +++++++++++- binutils/readelf.c | 31 +++++++++++++++++++------------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index fda5a6c..6acab33 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,12 @@ +2014-10-30 Nick Clifton + + Apply trunk patch: + + 2014-10-30 Nick Clifton + * readelf.c (CHECK_ENTSIZE_VALUES): Rewrite error message so that + there is a single string for translation. + (dynamic_section_mips_val): Likewise. + 2014-10-29 Nick Clifton * po/bg.po: Updated Bulgarian translation. @@ -6,7 +15,8 @@ 2014-10-28 Matthew Fortune - Apply trunk patches + Apply trunk patch: + 2014-10-22 Matthew Fortune * readelf.c (print_mips_ases): Print unknown ASEs. (print_mips_isa_ext): Print the value of an unknown extension. diff --git a/binutils/readelf.c b/binutils/readelf.c index bc79f03..6f3d084 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -5054,19 +5054,22 @@ process_section_headers (FILE * file) break; } -#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ - do \ - { \ - bfd_size_type expected_entsize = is_32bit_elf ? size32 : size64; \ - if (section->sh_entsize != expected_entsize) \ +#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ + do \ + { \ + bfd_size_type expected_entsize = is_32bit_elf ? size32 : size64; \ + if (section->sh_entsize != expected_entsize) \ { \ - error (_("Section %d has invalid sh_entsize of %" BFD_VMA_FMT "x\n"), \ - i, section->sh_entsize); \ - error (_("(Using the expected size of %d for the rest of this dump)\n"), \ - (int) expected_entsize); \ + char buf[40]; \ + sprintf_vma (buf, section->sh_entsize); \ + /* Note: coded this way so that there is a single string for \ + translation. */ \ + error (_("Section %d has invalid sh_entsize of %s\n"), i, buf); \ + error (_("(Using the expected size of %u for the rest of this dump)\n"), \ + (unsigned) expected_entsize); \ section->sh_entsize = expected_entsize; \ - } \ - } \ + } \ + } \ while (0) #define CHECK_ENTSIZE(section, i, type) \ @@ -7776,7 +7779,11 @@ dynamic_section_mips_val (Elf_Internal_Dyn * entry) if (VALID_DYNAMIC_NAME (entry->d_un.d_val)) printf (_("Interface Version: %s"), GET_DYNAMIC_NAME (entry->d_un.d_val)); else - printf (_(""), entry->d_un.d_ptr); + { + char buf[40]; + sprintf_vma (buf, entry->d_un.d_ptr); + /* Note: coded this way so that there is a single string for translation. */ + printf (_(""), buf); break; case DT_MIPS_TIME_STAMP: -- 2.7.4