+2014-05-26 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (handle_relocs_rela): Print header like handle_relocs_rel
+ does, when sh_info == 0.
+
2014-05-26 Mark Wielaard <mjw@redhat.com>
* unstrip.c (find_alloc_sections_prelink): Allow non-split .bss
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
- printf (ngettext ("\
+ if (shdr->sh_info != 0)
+ printf (ngettext ("\
\nRelocation section [%2zu] '%s' for section [%2u] '%s' at offset %#0" PRIx64 " contains %d entry:\n",
"\
\nRelocation section [%2zu] '%s' for section [%2u] '%s' at offset %#0" PRIx64 " contains %d entries:\n",
elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
shdr->sh_offset,
nentries);
+ else
+ /* The .rela.dyn section does not refer to a specific section but
+ instead of section index zero. Do not try to print a section
+ name. */
+ printf (ngettext ("\
+\nRelocation section [%2u] '%s' at offset %#0" PRIx64 " contains %d entry:\n",
+ "\
+\nRelocation section [%2u] '%s' at offset %#0" PRIx64 " contains %d entries:\n",
+ nentries),
+ (unsigned int) elf_ndxscn (scn),
+ elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
+ shdr->sh_offset,
+ nentries);
fputs_unlocked (class == ELFCLASS32
? gettext ("\
Offset Type Value Addend Name\n")