+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.
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
{
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));
}
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);
}
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);
}
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;
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);
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 ("\
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. */
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 ("\
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);
&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. */
&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;
}
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;
}
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:
if (readp != nexthdr)
{
size_t padding = nexthdr - readp;
- printf (gettext (" %Zu padding bytes\n"), padding);
+ printf (gettext (" %zu padding bytes\n"), padding);
readp = nexthdr;
}
}
{
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;
size_t pos = 0;
while (pos < len)
{
- printf (" 0x%08Zx ", pos);
+ printf (" 0x%08zx ", pos);
const size_t chunk = MIN (len - pos, 16);
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);
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);
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);
}
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;
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);
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));
}
}
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];
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;
}
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);
}
}
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;
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;
{
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)
+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.
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;
}
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;
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;
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;
}
|| (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;
}
}
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;
}
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;
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;
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;
}
+ strlen ("two") + 1
+ strlen ("three") + 1)))
{
- printf ("section %Zd's offset differs\n", cnt);
+ printf ("section %zd's offset differs\n", cnt);
result = 1;
}
+ 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;
}
}
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;
}
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;
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;
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;
}
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);
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);
}
/* 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)
{
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;
}
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)
/* 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;
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
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;
}
&& 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;
}
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;
}
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;
}
}
{
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]);
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,