summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2009-01-23 16:10:44 -0800
committerUlrich Drepper <[email protected]>2009-01-23 16:10:44 -0800
commitd7285e190a2d84b4120f5230320124bfa517e1c7 (patch)
tree10a98b1ef2172c02ec7f2f96ed70b2ec3f3bb2d4 /src/readelf.c
parent7a2a59144d6de340e8f4a3340a6bf3f5a4ac6dcd (diff)
Print .strtab, .dynstr, and .comment for -a option of readelf.
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/readelf.c b/src/readelf.c
index d5a3b8d4..88eb9a7c 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -275,6 +275,17 @@ static error_t
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':
@@ -290,6 +301,9 @@ parse_opt (int key, char *arg,
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':
@@ -387,15 +401,7 @@ parse_opt (int key, char *arg,
}
/* 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: