+2009-01-23 Ulrich Drepper <drepper@redhat.com>
+
+ * readelf.c (parse_opt): Move code to add to dump_data_sections and
+ string_sections list in local function add_dump_section. Adjust 'x'
+ key handling. For 'a' key add .strtab, .dynstr, and .comment section
+ to string_sections list.
+
2009-01-22 Roland McGrath <roland@redhat.com>
* readelf.c (print_phdr): Don't print section mapping when no sections.
parse_opt (int key, char *arg,
struct argp_state *state __attribute__ ((unused)))
{
+ void add_dump_section (const char *name)
+ {
+ struct section_argument *a = xmalloc (sizeof *a);
+ a->arg = name;
+ a->next = NULL;
+ struct section_argument ***tailp
+ = key == 'x' ? &dump_data_sections_tail : &string_sections_tail;
+ **tailp = a;
+ *tailp = &a->next;
+ }
+
switch (key)
{
case 'a':
print_arch = true;
print_notes = true;
print_debug_sections |= section_exception;
+ add_dump_section (".strtab");
+ add_dump_section (".dynstr");
+ add_dump_section (".comment");
any_control_option = true;
break;
case 'A':
}
/* Fall through. */
case 'x':
- {
- struct section_argument *a = xmalloc (sizeof *a);
- a->arg = arg;
- a->next = NULL;
- struct section_argument ***tailp
- = key == 'x' ? &dump_data_sections_tail : &string_sections_tail;
- **tailp = a;
- *tailp = &a->next;
- }
+ add_dump_section (arg);
any_control_option = true;
break;
case ARGP_KEY_NO_ARGS: