]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Print .strtab, .dynstr, and .comment for -a option of readelf.
authorUlrich Drepper <drepper@redhat.com>
Sat, 24 Jan 2009 00:10:44 +0000 (16:10 -0800)
committerUlrich Drepper <drepper@redhat.com>
Sat, 24 Jan 2009 00:10:44 +0000 (16:10 -0800)
src/ChangeLog
src/readelf.c

index da35a66876c7760f6f5e3ac2273195795e6aec52..30fdb07b72a2ba885fb7cb56b834aa83efd1a485 100644 (file)
@@ -1,3 +1,10 @@
+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.
index d5a3b8d4582c2a02e3ae6c8359be7d68d04a5d24..88eb9a7c8bc87162a528d18e5b6b769a90082208 100644 (file)
@@ -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: