+2010-08-11 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (for_each_section_argument): Process all sections with
+ matching name, not just the first.
+
2010-07-26 Roland McGrath <roland@redhat.com>
* readelf.c (print_ops): Take new argument for CU version.
{
/* Need to look up the section by name. */
scn = NULL;
+ bool found = false;
while ((scn = elf_nextscn (elf, scn)) != NULL)
{
if (gelf_getshdr (scn, &shdr_mem) == NULL)
if (name == NULL)
continue;
if (!strcmp (name, a->arg))
- break;
+ {
+ found = true;
+ (*dump) (scn, &shdr_mem, name);
+ }
}
- if (unlikely (scn == NULL))
- {
- if (!a->implicit)
- error (0, 0, gettext ("\nsection '%s' does not exist"), a->arg);
- continue;
- }
+ if (unlikely (!found) && !a->implicit)
+ error (0, 0, gettext ("\nsection '%s' does not exist"), a->arg);
}
-
- (*dump) (scn, &shdr_mem, name);
}
}