From f253158fafd213c209a5b2a56e22b53760a7132d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 12 Jul 2021 14:14:33 +0100 Subject: [PATCH] Fix a translation problem for the text generated by readelf at the start of a dump of a dynamic section. PR 28072 binutils * readelf.c (process_dynamic_section): Use ngettext to help with translation of header text. --- binutils/readelf.c | 56 +++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/binutils/readelf.c b/binutils/readelf.c index 24ff069edf4..5682837ed7b 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -10943,28 +10943,19 @@ the .dynstr section doesn't match the DT_STRTAB and DT_STRSZ tags\n")); if (do_dynamic && filedata->dynamic_addr) { - if (filedata->dynamic_nent == 1) - { - if (filedata->is_separate) - printf (_("\nIn linked file '%s' the dynamic section at offset 0x%lx contains 1 entry:\n"), - filedata->file_name, - filedata->dynamic_addr); - else - printf (_("\nDynamic section at offset 0x%lx contains 1 entry:\n"), - filedata->dynamic_addr); - } - else - { - if (filedata->is_separate) - printf (_("\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entries:\n"), - filedata->file_name, - filedata->dynamic_addr, - (unsigned long) filedata->dynamic_nent); + if (filedata->is_separate) + printf (ngettext ("\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entry:\n", + "\nIn linked file '%s' the dynamic section at offset 0x%lx contains %lu entries:\n", + (unsigned long) filedata->dynamic_nent), + filedata->file_name, + filedata->dynamic_addr, + (unsigned long) filedata->dynamic_nent); else - printf (_("\nDynamic section at offset 0x%lx contains %lu entries:\n"), + printf (ngettext ("\nDynamic section at offset 0x%lx contains %lu entry:\n", + "\nDynamic section at offset 0x%lx contains %lu entries:\n", + (unsigned long) filedata->dynamic_nent), filedata->dynamic_addr, (unsigned long) filedata->dynamic_nent); - } } if (do_dynamic) printf (_(" Tag Type Name/Value\n")); @@ -17295,24 +17286,27 @@ display_csky_attribute (unsigned char * p, break; case Tag_CSKY_FPU_ROUNDING: READ_ULEB (val, p, end); - if (val == 1) { - printf (" Tag_CSKY_FPU_ROUNDING:\t"); - printf ("Needed\n"); - } + if (val == 1) + { + printf (" Tag_CSKY_FPU_ROUNDING:\t"); + printf ("Needed\n"); + } break; case Tag_CSKY_FPU_DENORMAL: READ_ULEB (val, p, end); - if (val == 1) { - printf (" Tag_CSKY_FPU_DENORMAL:\t"); - printf ("Needed\n"); - } + if (val == 1) + { + printf (" Tag_CSKY_FPU_DENORMAL:\t"); + printf ("Needed\n"); + } break; case Tag_CSKY_FPU_Exception: READ_ULEB (val, p, end); - if (val == 1) { - printf (" Tag_CSKY_FPU_Exception:\t"); - printf ("Needed\n"); - } + if (val == 1) + { + printf (" Tag_CSKY_FPU_Exception:\t"); + printf ("Needed\n"); + } break; case Tag_CSKY_FPU_NUMBER_MODULE: printf (" Tag_CSKY_FPU_NUMBER_MODULE:\t"); -- 2.30.2