]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Replace printf %Z length modifier with %z.
authorChih-Hung Hsieh <chh@google.com>
Fri, 4 Sep 2015 17:13:02 +0000 (10:13 -0700)
committerMark Wielaard <mjw@redhat.com>
Mon, 7 Sep 2015 13:04:22 +0000 (15:04 +0200)
%Z is a GNU extension predating the ISO C99 %z modifier supported by
libc5 and no longer recommended.

Signed-off-by: Chih-Hung Hsieh <chh@google.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
17 files changed:
src/ChangeLog
src/elflint.c
src/findtextrel.c
src/ldscript.y
src/readelf.c
src/unstrip.c
tests/ChangeLog
tests/asm-tst1.c
tests/asm-tst2.c
tests/asm-tst3.c
tests/asm-tst4.c
tests/asm-tst5.c
tests/asm-tst6.c
tests/asm-tst7.c
tests/asm-tst8.c
tests/asm-tst9.c
tests/sectiondump.c

index 66f7ead1a487dfa944c0c2620fd18beb6fdd25d1..fb928075ffed20510cb241f21e02c1c6651b1ab5 100644 (file)
@@ -1,3 +1,28 @@
+2015-09-04  Chih-Hung Hsieh  <chh@google.com>
+
+       * elflint.c (check_group): Replace %Z length modifier with %z.
+       (check_note_data): Likewise.
+       * findtextrel.c (process_file): Likewise.
+       * readelf.c (handle_dynamic): Likewise.
+       (handle_symtab): Likewise.
+       (handle_verneed): Likewise.
+       (handle_verdef): Likewise.
+       (handle_versym): Likewise.
+       (print_hash_info): Likewise.
+       (print_decoded_aranges_section): Likewise.
+       (print_debug_aranges_section): Likewise.
+       (print_debug_line_section): Likewise.
+       (hex_dump): Likewise.
+       (dump_data_section): Likewise.
+       (print_string_section): Likewise.
+       (dump_archive_index): Likewise.
+       * unstrip.c (adjust_relocs): Likewise.
+       (collect_symbols): likewise.
+       (get_section_name): Likewise.
+       (find_alloc_sections_prelink): Likewise.
+       (copy_elided_sections): Likewise.
+       * ldscript.y (add_id_list): Add missing '%s'.
+
 2015-09-03  Mark Wielaard  <mjw@redhat.com>
 
        * readelf.c (handle_core_item): Handle right shift >= 32 bits.
index 0d5f34d44d9780b5c40d870e6f6dc349eac4c238..c1f0be5eee1bfbff59f4ee42c51e4d78ecc04f25 100644 (file)
@@ -2686,7 +2686,7 @@ section [%2d] '%s': section group with only one member\n"),
 
          if (val > shnum)
            ERROR (gettext ("\
-section [%2d] '%s': section index %Zu out of range\n"),
+section [%2d] '%s': section index %zu out of range\n"),
                   idx, section_name (ebl, idx), cnt / elsize);
          else
            {
@@ -2708,7 +2708,7 @@ section [%2d] '%s': section group contains another group [%2d] '%s'\n"),
 
                  if ((refshdr->sh_flags & SHF_GROUP) == 0)
                    ERROR (gettext ("\
-section [%2d] '%s': element %Zu references section [%2d] '%s' without SHF_GROUP flag set\n"),
+section [%2d] '%s': element %zu references section [%2d] '%s' without SHF_GROUP flag set\n"),
                           idx, section_name (ebl, idx), cnt / elsize,
                           val, section_name (ebl, val));
                }
@@ -4246,7 +4246,7 @@ phdr[%d]: unknown core file note type %" PRIu32 " at offset %" PRIu64 "\n"),
            else
              ERROR (gettext ("\
 section [%2d] '%s': unknown core file note type %" PRIu32
-                             " at offset %Zu\n"),
+                             " at offset %zu\n"),
                     shndx, section_name (ebl, shndx),
                     (uint32_t) nhdr.n_type, offset);
          }
@@ -4268,12 +4268,12 @@ section [%2d] '%s': unknown core file note type %" PRIu32
          default:
            if (shndx == 0)
              ERROR (gettext ("\
-phdr[%d]: unknown object file note type %" PRIu32 " at offset %Zu\n"),
+phdr[%d]: unknown object file note type %" PRIu32 " at offset %zu\n"),
                     phndx, (uint32_t) nhdr.n_type, offset);
            else
              ERROR (gettext ("\
 section [%2d] '%s': unknown object file note type %" PRIu32
-                             " at offset %Zu\n"),
+                             " at offset %zu\n"),
                     shndx, section_name (ebl, shndx),
                     (uint32_t) nhdr.n_type, offset);
          }
index 6f1a4b5572ad5bd07580aff625ec95c43fdfbabb..0ac6ede287ea4b0e1e2645b71a6663b6b4c95f0a 100644 (file)
@@ -406,7 +406,7 @@ cannot get program header index at offset %zd: %s"),
          if (shdr == NULL)
            {
              error (0, 0,
-                    gettext ("cannot get section header of section %Zu: %s"),
+                    gettext ("cannot get section header of section %zu: %s"),
                     elf_ndxscn (scn), elf_errmsg (-1));
              result = 1;
              goto next;
index ec58e21aa17a08550713940054f9effcb232f67c..3502ce19abf613e4a20e58c51f01169c62879615 100644 (file)
@@ -735,7 +735,7 @@ add_id_list (const char *versionname, struct id_list *runp, _Bool local)
            if (defp != NULL && defp->u.s.local != local)
              error (EXIT_FAILURE, 0, versionname[0] == '\0'
                     ? gettext ("\
-symbol '%s' is declared both local and global for unnamed version")
+symbol '%s' is declared both local and global for unnamed version '%s'")
                     : gettext ("\
 symbol '%s' is declared both local and global for version '%s'"),
                     runp->id, versionname);
index aab8b5ccd6508baedfb11fc59649ceaee40ce120..8e644003f799396b52ff2f016563f97e76a74035 100644 (file)
@@ -1582,7 +1582,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
 
   glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
   if (glink == NULL)
-    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
           elf_ndxscn (scn));
 
   printf (ngettext ("\
@@ -2205,7 +2205,7 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
   GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
                                   &glink_mem);
   if (glink == NULL)
-    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
           elf_ndxscn (scn));
 
   /* Now we can compute the number of entries in the section.  */
@@ -2463,7 +2463,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
   GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
                                   &glink_mem);
   if (glink == NULL)
-    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
           elf_ndxscn (scn));
 
   printf (ngettext ("\
@@ -2539,7 +2539,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
   GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
                                   &glink_mem);
   if (glink == NULL)
-    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
           elf_ndxscn (scn));
 
   int class = gelf_getclass (ebl->elf);
@@ -2843,7 +2843,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
                                   &glink_mem);
   size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_HALF, 1, EV_CURRENT);
   if (glink == NULL)
-    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
+    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %zu"),
           elf_ndxscn (scn));
 
   /* Print the header.  */
@@ -2917,7 +2917,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx,
                                   &glink_mem);
   if (glink == NULL)
     {
-      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
+      error (0, 0, gettext ("invalid sh_link value in section %zu"),
             elf_ndxscn (scn));
       return;
     }
@@ -4605,7 +4605,7 @@ print_decoded_aranges_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
   glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
   if (glink == NULL)
     {
-      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
+      error (0, 0, gettext ("invalid sh_link value in section %zu"),
             elf_ndxscn (scn));
       return;
     }
@@ -4686,7 +4686,7 @@ print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
       const unsigned char *hdrstart = readp;
       size_t start_offset = hdrstart - (const unsigned char *) data->d_buf;
 
-      printf (gettext ("\nTable at offset %Zu:\n"), start_offset);
+      printf (gettext ("\nTable at offset %zu:\n"), start_offset);
       if (readp + 4 > readendp)
        {
        invalid_data:
@@ -4804,7 +4804,7 @@ print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
       if (readp != nexthdr)
        {
          size_t padding = nexthdr - readp;
-         printf (gettext ("   %Zu padding bytes\n"), padding);
+         printf (gettext ("   %zu padding bytes\n"), padding);
          readp = nexthdr;
        }
     }
@@ -6383,7 +6383,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
     {
       size_t start_offset = linep - (const unsigned char *) data->d_buf;
 
-      printf (gettext ("\nTable at offset %Zu:\n"), start_offset);
+      printf (gettext ("\nTable at offset %zu:\n"), start_offset);
 
       if (unlikely (linep + 4 > lineendp))
        goto invalid_data;
@@ -9355,7 +9355,7 @@ hex_dump (const uint8_t *data, size_t len)
   size_t pos = 0;
   while (pos < len)
     {
-      printf ("  0x%08Zx ", pos);
+      printf ("  0x%08zx ", pos);
 
       const size_t chunk = MIN (len - pos, 16);
 
@@ -9383,17 +9383,17 @@ static void
 dump_data_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
 {
   if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
-    printf (gettext ("\nSection [%Zu] '%s' has no data to dump.\n"),
+    printf (gettext ("\nSection [%zu] '%s' has no data to dump.\n"),
            elf_ndxscn (scn), name);
   else
     {
       Elf_Data *data = elf_rawdata (scn, NULL);
       if (data == NULL)
-       error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+       error (0, 0, gettext ("cannot get data for section [%zu] '%s': %s"),
               elf_ndxscn (scn), name, elf_errmsg (-1));
       else
        {
-         printf (gettext ("\nHex dump of section [%Zu] '%s', %" PRIu64
+         printf (gettext ("\nHex dump of section [%zu] '%s', %" PRIu64
                           " bytes at offset %#0" PRIx64 ":\n"),
                  elf_ndxscn (scn), name,
                  shdr->sh_size, shdr->sh_offset);
@@ -9406,17 +9406,17 @@ static void
 print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
 {
   if (shdr->sh_size == 0 || shdr->sh_type == SHT_NOBITS)
-    printf (gettext ("\nSection [%Zu] '%s' has no strings to dump.\n"),
+    printf (gettext ("\nSection [%zu] '%s' has no strings to dump.\n"),
            elf_ndxscn (scn), name);
   else
     {
       Elf_Data *data = elf_rawdata (scn, NULL);
       if (data == NULL)
-       error (0, 0, gettext ("cannot get data for section [%Zu] '%s': %s"),
+       error (0, 0, gettext ("cannot get data for section [%zu] '%s': %s"),
               elf_ndxscn (scn), name, elf_errmsg (-1));
       else
        {
-         printf (gettext ("\nString section [%Zu] '%s' contains %" PRIu64
+         printf (gettext ("\nString section [%zu] '%s' contains %" PRIu64
                           " bytes at offset %#0" PRIx64 ":\n"),
                  elf_ndxscn (scn), name,
                  shdr->sh_size, shdr->sh_offset);
@@ -9429,11 +9429,11 @@ print_string_section (Elf_Scn *scn, const GElf_Shdr *shdr, const char *name)
              const size_t pos = start - (const char *) data->d_buf;
              if (unlikely (end == NULL))
                {
-                 printf ("  [%6Zx]- %.*s\n",
+                 printf ("  [%6zx]- %.*s\n",
                          pos, (int) (limit - start), start);
                  break;
                }
-             printf ("  [%6Zx]  %s\n", pos, start);
+             printf ("  [%6zx]  %s\n", pos, start);
              start = end + 1;
            } while (start < limit);
        }
@@ -9557,7 +9557,7 @@ dump_archive_index (Elf *elf, const char *fname)
       return;
     }
 
-  printf (gettext ("\nIndex of archive '%s' has %Zu entries:\n"),
+  printf (gettext ("\nIndex of archive '%s' has %zu entries:\n"),
          fname, narsym);
 
   size_t as_off = 0;
@@ -9575,7 +9575,7 @@ dump_archive_index (Elf *elf, const char *fname)
            while (1)
 #endif
              error (EXIT_FAILURE, 0,
-                    gettext ("cannot extract member at offset %Zu in '%s': %s"),
+                    gettext ("cannot extract member at offset %zu in '%s': %s"),
                     as_off, fname, elf_errmsg (-1));
 
          const Elf_Arhdr *h = elf_getarhdr (subelf);
index 8833094607c514f36ab05829049677cfcf5e20a2..82bcdd87355a34fe64e5014a7cced9f8ed3a6ed7 100644 (file)
@@ -523,7 +523,7 @@ adjust_relocs (Elf_Scn *outscn, Elf_Scn *inscn, const GElf_Shdr *shdr,
 
     default:
       error (EXIT_FAILURE, 0,
-            _("unexpected section type in [%Zu] with sh_link to symtab"),
+            _("unexpected section type in [%zu] with sh_link to symtab"),
             elf_ndxscn (inscn));
     }
 }
@@ -771,7 +771,7 @@ collect_symbols (Elf *outelf, bool rel, Elf_Scn *symscn, Elf_Scn *strscn,
 
       if (sym->st_name >= strdata->d_size)
        error (EXIT_FAILURE, 0,
-              _("invalid string offset in symbol [%Zu]"), i);
+              _("invalid string offset in symbol [%zu]"), i);
 
       struct symbol *s = &table[i - 1];
       s->map = &map[i - 1];
@@ -929,7 +929,7 @@ static inline const char *
 get_section_name (size_t ndx, const GElf_Shdr *shdr, const Elf_Data *shstrtab)
 {
   if (shdr->sh_name >= shstrtab->d_size)
-    error (EXIT_FAILURE, 0, _("cannot read section [%Zu] name: %s"),
+    error (EXIT_FAILURE, 0, _("cannot read section [%zu] name: %s"),
           ndx, elf_errmsg (-1));
   return shstrtab->d_buf + shdr->sh_name;
 }
@@ -1065,7 +1065,7 @@ find_alloc_sections_prelink (Elf *debug, Elf_Data *debug_shstrtab,
       if (!match)
        {
          fail = true;
-         error (0, 0, _("cannot find matching section for [%Zu] '%s'"),
+         error (0, 0, _("cannot find matching section for [%zu] '%s'"),
                 elf_ndxscn (scn), name);
        }
     }
@@ -1270,7 +1270,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
       sections[i].name = elf_strptr (stripped, stripped_shstrndx,
                                     shdr->sh_name);
       if (sections[i].name == NULL)
-       error (EXIT_FAILURE, 0, _("cannot read section [%Zu] name: %s"),
+       error (EXIT_FAILURE, 0, _("cannot read section [%zu] name: %s"),
               elf_ndxscn (scn), elf_errmsg (-1));
       sections[i].scn = scn;
       sections[i].outscn = NULL;
@@ -1390,7 +1390,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
 
       if (sec == NULL)
        error (EXIT_FAILURE, 0,
-              _("cannot find matching section for [%Zu] '%s'"),
+              _("cannot find matching section for [%zu] '%s'"),
               elf_ndxscn (scn), name);
 
       sec->outscn = scn;
@@ -1575,7 +1575,7 @@ more sections in stripped file than debug file -- arguments reversed?"));
                  {
                    if (shndx >= stripped_shnum)
                      error (EXIT_FAILURE, 0,
-                            _("symbol [%Zu] has invalid section index"), i);
+                            _("symbol [%zu] has invalid section index"), i);
 
                    shndx = ndx_section[shndx - 1];
                    if (shndx < SHN_LORESERVE)
index 09cd4e3a641cf6025fcebb653471d498c5fcec31..99b4d8f1e84130b0843c422f8d01942b24b83e62 100644 (file)
@@ -1,3 +1,16 @@
+2015-09-04  Chih-Hung Hsieh  <chh@google.com>
+
+       * asm-tst1.c (main): Replace %Z length modifier with %z.
+       * asm-tst2.c (main): Likewise.
+       * asm-tst3.c (main): Likewise.
+       * asm-tst4.c (main): Likewise.
+       * asm-tst5.c (main): Likewise.
+       * asm-tst6.c (main): Likewise.
+       * asm-tst7.c (main): Likewise.
+       * asm-tst8.c (main): Likewise.
+       * asm-tst9.c (main): Likewise.
+       * sectiondump.c (print_bytes): Likewise.
+
 2015-08-14  Mark Wielaard  <mjw@redhat.com>
 
        * run-addr2line-alt-debugpath.sh: New test.
index f611d66b2d059f15b828e68f10df41bbcfe3c3f8..9afc676b2e40058c41324f4dc80b32aef8e99cbf 100644 (file)
@@ -160,7 +160,7 @@ main (void)
       scn = elf_getscn (elf, cnt);
       if (scn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -168,7 +168,7 @@ main (void)
       shdr = gelf_getshdr (scn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
@@ -177,7 +177,7 @@ main (void)
       if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]) != 0)
        {
-         printf ("section %Zd's name differs: %s vs %s\n", cnt,
+         printf ("section %zd's name differs: %s vs %s\n", cnt,
                  elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]);
          result = 1;
@@ -185,7 +185,7 @@ main (void)
 
       if (shdr->sh_type != (cnt == 3 ? SHT_STRTAB : SHT_PROGBITS))
        {
-         printf ("section %Zd's type differs\n", cnt);
+         printf ("section %zd's type differs\n", cnt);
          result = 1;
        }
 
@@ -193,51 +193,51 @@ main (void)
          || (cnt == 2 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE))
          || (cnt == 3 && shdr->sh_flags != 0))
        {
-         printf ("section %Zd's flags differs\n", cnt);
+         printf ("section %zd's flags differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_addr != 0)
        {
-         printf ("section %Zd's address differs\n", cnt);
+         printf ("section %zd's address differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_offset != ((sizeof (Elf32_Ehdr) + 31) & ~31))
        {
-         printf ("section %Zd's offset differs\n", cnt);
+         printf ("section %zd's offset differs\n", cnt);
          result = 1;
        }
 
       if ((cnt != 3 && shdr->sh_size != 0)
          || (cnt == 3 && shdr->sh_size != 23))
        {
-         printf ("section %Zd's size differs\n", cnt);
+         printf ("section %zd's size differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_link != 0)
        {
-         printf ("section %Zd's link differs\n", cnt);
+         printf ("section %zd's link differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_info != 0)
        {
-         printf ("section %Zd's info differs\n", cnt);
+         printf ("section %zd's info differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_addralign != 32)
          || (cnt != 1 && shdr->sh_addralign != 1))
        {
-         printf ("section %Zd's addralign differs\n", cnt);
+         printf ("section %zd's addralign differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_entsize != 0)
        {
-         printf ("section %Zd's entsize differs\n", cnt);
+         printf ("section %zd's entsize differs\n", cnt);
          result = 1;
        }
     }
index 41bf13aeecad82b877224f74e0f3ac99dae09e21..2556d0c414ba9fb241301cdf36c6bb1ed63222d2 100644 (file)
@@ -176,7 +176,7 @@ main (void)
       scn = elf_getscn (elf, cnt);
       if (scn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -184,7 +184,7 @@ main (void)
       shdr = gelf_getshdr (scn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
@@ -193,7 +193,7 @@ main (void)
       if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]) != 0)
        {
-         printf ("section %Zd's name differs: %s vs %s\n", cnt,
+         printf ("section %zd's name differs: %s vs %s\n", cnt,
                  elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]);
          result = 1;
@@ -201,20 +201,20 @@ main (void)
 
       if (shdr->sh_type != (cnt == 2 ? SHT_STRTAB : SHT_PROGBITS))
        {
-         printf ("section %Zd's type differs\n", cnt);
+         printf ("section %zd's type differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE))
          || (cnt == 2 && shdr->sh_flags != 0))
        {
-         printf ("section %Zd's flags differs\n", cnt);
+         printf ("section %zd's flags differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_addr != 0)
        {
-         printf ("section %Zd's address differs\n", cnt);
+         printf ("section %zd's address differs\n", cnt);
          result = 1;
        }
 
@@ -225,7 +225,7 @@ main (void)
                                     + strlen ("two") + 1
                                     + strlen ("three") + 1)))
        {
-         printf ("section %Zd's offset differs\n", cnt);
+         printf ("section %zd's offset differs\n", cnt);
          result = 1;
        }
 
@@ -234,32 +234,32 @@ main (void)
                                         + strlen ("three") + 1))
          || (cnt == 2 && shdr->sh_size != 17))
        {
-         printf ("section %Zd's size differs\n", cnt);
+         printf ("section %zd's size differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_link != 0)
        {
-         printf ("section %Zd's link differs\n", cnt);
+         printf ("section %zd's link differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_info != 0)
        {
-         printf ("section %Zd's info differs\n", cnt);
+         printf ("section %zd's info differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_addralign != 16)
          || (cnt != 1 && shdr->sh_addralign != 1))
        {
-         printf ("section %Zd's addralign differs\n", cnt);
+         printf ("section %zd's addralign differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_entsize != 0)
        {
-         printf ("section %Zd's entsize differs\n", cnt);
+         printf ("section %zd's entsize differs\n", cnt);
          result = 1;
        }
     }
index acec1a481652f12e7999f8cd783e0b5793208ef2..e52cfbe11a5633a35408ca5bb3c520917092f756 100644 (file)
@@ -176,7 +176,7 @@ main (void)
       scn = elf_getscn (elf, cnt);
       if (scn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -184,7 +184,7 @@ main (void)
       shdr = gelf_getshdr (scn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
@@ -193,7 +193,7 @@ main (void)
       if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]) != 0)
        {
-         printf ("section %Zd's name differs: %s vs %s\n", cnt,
+         printf ("section %zd's name differs: %s vs %s\n", cnt,
                  elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]);
          result = 1;
@@ -201,20 +201,20 @@ main (void)
 
       if (shdr->sh_type != scntypes[cnt])
        {
-         printf ("section %Zd's type differs\n", cnt);
+         printf ("section %zd's type differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE))
          || (cnt != 1 && shdr->sh_flags != 0))
        {
-         printf ("section %Zd's flags differs\n", cnt);
+         printf ("section %zd's flags differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_addr != 0)
        {
-         printf ("section %Zd's address differs\n", cnt);
+         printf ("section %zd's address differs\n", cnt);
          result = 1;
        }
 
index 4788b79ed8de38469eeca334d2680e7b24f9f996..52e9e20bca33bad93e74f1818cc97319b5a7ebb1 100644 (file)
@@ -62,7 +62,7 @@ main (void)
       AsmScn_t *scn;
 
       /* Create a unique name.  */
-      snprintf (buf, sizeof (buf), ".data.%Zu", cnt);
+      snprintf (buf, sizeof (buf), ".data.%zu", cnt);
 
       /* Create the section.  */
       scn = asm_newscn (ctx, buf, SHT_PROGBITS, SHF_ALLOC | SHF_WRITE);
index d97d4be93d37dee611a48c014263765c2c1d3a7d..5a29b01c35994468d3708a82a480fefe971f5407 100644 (file)
@@ -64,7 +64,7 @@ main (void)
       AsmScn_t *scn;
 
       /* Create a unique name.  */
-      snprintf (buf, sizeof (buf), ".data.%Zu", cnt);
+      snprintf (buf, sizeof (buf), ".data.%zu", cnt);
 
       /* Create the section.  */
       scn = asm_newscn (ctx, buf, SHT_PROGBITS, SHF_ALLOC | SHF_WRITE);
@@ -77,7 +77,7 @@ main (void)
        }
 
       /* Add a name.  */
-      snprintf (buf, sizeof (buf), "%Zu", cnt);
+      snprintf (buf, sizeof (buf), "%zu", cnt);
       if (asm_newsym (scn, buf, sizeof (uint32_t), STT_OBJECT,
                      STB_GLOBAL) == NULL)
        {
index 35854d52031c987f446a963f5e1017088fd5e523..bd9b362b9be3f9382a77d1c3e7b3f8857f795dcd 100644 (file)
@@ -62,11 +62,11 @@ main (void)
       AsmScn_t *scn;
       AsmSym_t *sym;
 
-      snprintf (buf, sizeof (buf), ".grp%Zu", cnt);
+      snprintf (buf, sizeof (buf), ".grp%zu", cnt);
       grp = asm_newscngrp (ctx, buf, NULL, 0);
       if (grp == NULL)
        {
-         printf ("cannot section group %Zu: %s\n", cnt, asm_errmsg (-1));
+         printf ("cannot section group %zu: %s\n", cnt, asm_errmsg (-1));
          asm_abort (ctx);
          return 1;
        }
@@ -75,14 +75,14 @@ main (void)
                              SHF_ALLOC | SHF_WRITE, grp);
       if (scn == NULL)
        {
-         printf ("cannot data section for group %Zu: %s\n",
+         printf ("cannot data section for group %zu: %s\n",
                  cnt, asm_errmsg (-1));
          asm_abort (ctx);
          return 1;
        }
 
       /* Add a name.  */
-      snprintf (buf, sizeof (buf), "%Zu", cnt);
+      snprintf (buf, sizeof (buf), "%zu", cnt);
       sym = asm_newsym (scn, buf, sizeof (uint32_t), STT_OBJECT,
                        STB_GLOBAL);
       if (sym == NULL)
@@ -104,7 +104,7 @@ main (void)
       /* Now we have a symbol, use it as the signature.  */
       if (asm_scngrp_newsignature (grp, sym) != 0)
        {
-         printf ("cannot set signature for section group %Zu: %s\n",
+         printf ("cannot set signature for section group %zu: %s\n",
                  cnt, asm_errmsg (-1));
          asm_abort (ctx);
          return 1;
@@ -114,7 +114,7 @@ main (void)
       scn = asm_newscn_ingrp (ctx, ".stab", SHT_PROGBITS, 0, grp);
       if (scn == NULL)
        {
-         printf ("cannot stab section for group %Zu: %s\n",
+         printf ("cannot stab section for group %zu: %s\n",
                  cnt, asm_errmsg (-1));
          asm_abort (ctx);
          return 1;
index a875eb4c2f1f99558b52f37c66aa93fc26984edc..00cb2bfe6319f23a10f5489d1f226b37677a23b9 100644 (file)
@@ -102,7 +102,7 @@ main (void)
       scn = elf_getscn (elf, cnt);
       if (scn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -110,7 +110,7 @@ main (void)
       shdr = gelf_getshdr (scn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
index 597c5cb3d61df968cac3883dee07652bfbcae4cc..4fb0d998712ee5588ae5a86d37874f94013f1507 100644 (file)
@@ -103,7 +103,7 @@ main (void)
       scn = elf_getscn (elf, cnt);
       if (scn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -111,7 +111,7 @@ main (void)
       shdr = gelf_getshdr (scn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
index b9fcdd4d8ba490c8037821f5fadff96270c895f7..b6d0e4314b3a354fb620da954a7f4a34b12608ef 100644 (file)
@@ -210,7 +210,7 @@ main (void)
       escn = elf_getscn (elf, cnt);
       if (escn == NULL)
        {
-         printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1));
+         printf ("cannot get section %zd: %s\n", cnt, elf_errmsg (-1));
          result = 1;
          continue;
        }
@@ -218,7 +218,7 @@ main (void)
       shdr = gelf_getshdr (escn, &shdr_mem);
       if (shdr == NULL)
        {
-         printf ("cannot get section header for section %Zd: %s\n",
+         printf ("cannot get section header for section %zd: %s\n",
                  cnt, elf_errmsg (-1));
          result = 1;
          continue;
@@ -227,7 +227,7 @@ main (void)
       if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]) != 0)
        {
-         printf ("section %Zd's name differs: %s vs %s\n", cnt,
+         printf ("section %zd's name differs: %s vs %s\n", cnt,
                  elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name),
                  scnnames[cnt]);
          result = 1;
@@ -235,20 +235,20 @@ main (void)
 
       if (shdr->sh_type != (cnt == 2 ? SHT_STRTAB : SHT_PROGBITS))
        {
-         printf ("section %Zd's type differs\n", cnt);
+         printf ("section %zd's type differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE))
          || (cnt == 2 && shdr->sh_flags != 0))
        {
-         printf ("section %Zd's flags differs\n", cnt);
+         printf ("section %zd's flags differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_addr != 0)
        {
-         printf ("section %Zd's address differs\n", cnt);
+         printf ("section %zd's address differs\n", cnt);
          result = 1;
        }
 
@@ -257,39 +257,39 @@ main (void)
              && shdr->sh_offset != (((sizeof (Elf32_Ehdr) + 15) & ~15)
                                     + sizeof (expecteddata))))
        {
-         printf ("section %Zd's offset differs\n", cnt);
+         printf ("section %zd's offset differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_size != sizeof (expecteddata))
          || (cnt == 2 && shdr->sh_size != 17))
        {
-         printf ("section %Zd's size differs\n", cnt);
+         printf ("section %zd's size differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_link != 0)
        {
-         printf ("section %Zd's link differs\n", cnt);
+         printf ("section %zd's link differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_info != 0)
        {
-         printf ("section %Zd's info differs\n", cnt);
+         printf ("section %zd's info differs\n", cnt);
          result = 1;
        }
 
       if ((cnt == 1 && shdr->sh_addralign != 16)
          || (cnt != 1 && shdr->sh_addralign != 1))
        {
-         printf ("section %Zd's addralign differs\n", cnt);
+         printf ("section %zd's addralign differs\n", cnt);
          result = 1;
        }
 
       if (shdr->sh_entsize != 0)
        {
-         printf ("section %Zd's entsize differs\n", cnt);
+         printf ("section %zd's entsize differs\n", cnt);
          result = 1;
        }
 
@@ -299,14 +299,14 @@ main (void)
 
          if (data == NULL)
            {
-             printf ("cannot get data of section %Zd\n", cnt);
+             printf ("cannot get data of section %zd\n", cnt);
              result = 1;
            }
          else
            {
              if (data->d_size != sizeof (expecteddata))
                {
-                 printf ("data block size of section %Zd wrong: got %Zd, "
+                 printf ("data block size of section %zd wrong: got %zd, "
                          "expected 96\n", cnt, data->d_size);
                  result = 1;
                }
@@ -314,7 +314,7 @@ main (void)
              if (memcmp (data->d_buf, expecteddata, sizeof (expecteddata))
                  != 0)
                {
-                 printf ("data block content of section %Zd wrong\n", cnt);
+                 printf ("data block content of section %zd wrong\n", cnt);
                  result = 1;
                }
            }
index f86595493ea9ce595bd190a43b58be36429a96dd..3033fedcc3310f27f37a3189005591c8aa200fdd 100644 (file)
@@ -149,7 +149,7 @@ print_bytes (Elf_Data *data)
     {
       size_t inner;
 
-      printf ("%*Zx: ", sizeof (size_t) == 4 ? 8 : 16, (size_t) offset + cnt);
+      printf ("%*zx: ", sizeof (size_t) == 4 ? 8 : 16, (size_t) offset + cnt);
 
       for (inner = 0; inner < 16 && cnt + inner < size; ++inner)
        printf (" %02hhx", buf[cnt + inner]);
@@ -172,7 +172,7 @@ print_symtab (Elf *elf, Elf_Data *data)
       GElf_Sym sym_mem;
       GElf_Sym *sym = gelf_getsym (data, cnt, &sym_mem);
 
-      printf ("%5Zu: %*" PRIx64 " %6" PRIx64 " %4d\n",
+      printf ("%5zu: %*" PRIx64 " %6" PRIx64 " %4d\n",
              cnt,
              class == ELFCLASS32 ? 8 : 16,
              sym->st_value,