]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Avoid YESSTR and NOSTR
authorUlf Hermann <ulf.hermann@qt.io>
Thu, 20 Apr 2017 13:47:49 +0000 (15:47 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 25 Apr 2017 22:38:29 +0000 (00:38 +0200)
Those are deprecated and apparently some implementations of nl_langinfo
return empty strings for them. The tests even tested for those empty
strings even though the intention of the code was clearly to output
"yes" or "no" there.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
src/ChangeLog
src/readelf.c
tests/ChangeLog
tests/run-readelf-dwz-multi.sh
tests/run-readelf-zdebug-rel.sh

index a1bec198d41bb52162e9fd4b00be4a32377cf97b..e0a591e237d567599501a352d12e800000619849 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-20  Ulf Hermann <ulf.hermann@qt.io>
+
+       * readelf.c: Replace YESSTR and NOSTR with gettext ("yes") and
+       gettext ("no"), respectively.
+
 2017-04-05  Mark Wielaard  <mark@klomp.org>
 
        * elflint.c (check_elf_header): Decompress all sections.
index 97a43b06659c75b37b85905106e8a7f9bde9f638..6f6095d258eb6712607e579cf25e30772dd4069a 100644 (file)
@@ -6132,7 +6132,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
 
       printf ("           %*s%-20s (%s) %s\n",
              (int) (level * 2), "", dwarf_attr_name (attr),
-             dwarf_form_name (form), nl_langinfo (flag ? YESSTR : NOSTR));
+             dwarf_form_name (form), flag ? gettext ("yes") : gettext ("no"));
       break;
 
     case DW_FORM_flag_present:
@@ -6140,7 +6140,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
        break;
       printf ("           %*s%-20s (%s) %s\n",
              (int) (level * 2), "", dwarf_attr_name (attr),
-             dwarf_form_name (form), nl_langinfo (YESSTR));
+             dwarf_form_name (form), gettext ("yes"));
       break;
 
     case DW_FORM_exprloc:
@@ -7650,7 +7650,7 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
                      if (readp + 1 > readendp)
                        goto invalid_data;
                      val = *readp++;
-                     printf (" %s", nl_langinfo (val != 0 ? YESSTR : NOSTR));
+                     printf (" %s", val != 0 ? gettext ("yes") : gettext ("no"));
                      break;
 
                    case DW_FORM_string:
index ebcd7bcce8671937f8058991446ce39e23b734e1..c4e76d150defe9439790b6ebbe7f16b1e430ed7e 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-20  Ulf Hermann <ulf.hermann@qt.io>
+
+       * run-readelf-dwz-multi.sh: Expect readelf to output "yes" for flags
+       that are set.
+       * run-readelf-zdebug-rel.sh: Likewise.
+
 2017-04-20  Ulf Hermann <ulf.hermann@qt.io>
 
        * backtrace-child.c: Include sys/ptrace.h only on linux.
index 27e0f38c02d52587e22e3ef5ce5daa32bc49f412..23ca944c3f1ab316d44638710635fb3a36777301 100755 (executable)
@@ -98,17 +98,17 @@ DWARF section [28] '.debug_info' at offset 0x1078:
              byte_size            (data1) 8
              type                 (GNU_ref_alt) [    53]
  [    31]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (strp) "main"
              decl_file            (data1) 1
              decl_line            (data1) 3
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (GNU_ref_alt) [    3e]
              low_pc               (addr) 0x00000000004006ac <main>
              high_pc              (udata) 44 (0x00000000004006d8)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_tail_call_sites (flag_present) 
+             GNU_all_tail_call_sites (flag_present) yes
              sibling              (ref_udata) [    6e]
  [    48]      formal_parameter
                name                 (strp) "argc"
@@ -159,17 +159,17 @@ DWARF section [28] '.debug_info' at offset 0x1078:
              byte_size            (data1) 8
              type                 (GNU_ref_alt) [    53]
  [    31]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (strp) "main"
              decl_file            (data1) 1
              decl_line            (data1) 3
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (GNU_ref_alt) [    3e]
              low_pc               (addr) 0x00000000004006ac <main>
              high_pc              (udata) 44 (0x00000000004006d8)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_tail_call_sites (flag_present) 
+             GNU_all_tail_call_sites (flag_present) yes
              sibling              (ref_udata) [    6e]
  [    48]      formal_parameter
                name                 (strp) "argc"
@@ -216,17 +216,17 @@ DWARF section [25] '.debug_info' at offset 0x106c:
  [    26]    imported_unit
              import               (GNU_ref_alt) [     b]
  [    2b]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (strp) "call_foo"
              decl_file            (data1) 1
              decl_line            (data1) 3
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (GNU_ref_alt) [    3e]
              low_pc               (addr) +0x0000000000000670 <call_foo>
              high_pc              (udata) 23 (+0x0000000000000687)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_call_sites   (flag_present) 
+             GNU_all_call_sites   (flag_present) yes
  [    41]      formal_parameter
                name                 (string) "fb"
                decl_file            (data1) 1
@@ -256,17 +256,17 @@ DWARF section [25] '.debug_info' at offset 0x106c:
  [    26]    imported_unit
              import               (GNU_ref_alt) [     b]
  [    2b]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (strp) "call_foo"
              decl_file            (data1) 1
              decl_line            (data1) 3
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (GNU_ref_alt) [    3e]
              low_pc               (addr) +0x0000000000000670 <call_foo>
              high_pc              (udata) 23 (+0x0000000000000687)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_call_sites   (flag_present) 
+             GNU_all_call_sites   (flag_present) yes
  [    41]      formal_parameter
                name                 (string) "fb"
                decl_file            (data1) 1
@@ -295,17 +295,17 @@ DWARF section [28] '.debug_info' at offset 0x1088:
  [    26]    imported_unit
              import               (GNU_ref_alt) [     b]
  [    2b]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (GNU_strp_alt) "main"
              decl_file            (data1) 1
              decl_line            (data1) 8
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (GNU_ref_alt) [    30]
              low_pc               (addr) 0x00000000004004ec <main>
              high_pc              (udata) 18 (0x00000000004004fe)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_call_sites   (flag_present) 
+             GNU_all_call_sites   (flag_present) yes
  [    41]      formal_parameter
                name                 (GNU_strp_alt) "argc"
                decl_file            (data1) 1
index 88ea5bf2d5a018250e232b290e82d278e2093df5..1232d63b38776755927517086a162e4c29f80933 100755 (executable)
@@ -60,17 +60,17 @@ DWARF section [ 4] '.debug_info' at offset 0x58:
            high_pc              (data8) 24 (0x0000000000000018)
            stmt_list            (sec_offset) 0
  [    2d]    subprogram
-             external             (flag_present) 
+             external             (flag_present) yes
              name                 (strp) "main"
              decl_file            (data1) 1
              decl_line            (data1) 4
-             prototyped           (flag_present) 
+             prototyped           (flag_present) yes
              type                 (ref4) [    80]
              low_pc               (addr) 000000000000000000
              high_pc              (data8) 24 (0x0000000000000018)
              frame_base           (exprloc) 
               [   0] call_frame_cfa
-             GNU_all_call_sites   (flag_present) 
+             GNU_all_call_sites   (flag_present) yes
              sibling              (ref4) [    80]
  [    4e]      formal_parameter
                name                 (strp) "argc"