daily update
[deliverable/binutils-gdb.git] / binutils / objdump.c
index e49f0aecfcfe8fb48c72814d904aa42fd0419bad..f2b5eea01286bb8ee104f551f6bd8578c8dec617 100644 (file)
@@ -196,6 +196,7 @@ usage (FILE *stream, int status)
   -T, --dynamic-syms       Display the contents of the dynamic symbol table\n\
   -r, --reloc              Display the relocation entries in the file\n\
   -R, --dynamic-reloc      Display the dynamic relocation entries in the file\n\
+  @<file>                  Read options from <file>\n\
   -v, --version            Display this program's version number\n\
   -i, --info               List object formats and architectures supported\n\
   -H, --help               Display this information\n\
@@ -2055,6 +2056,51 @@ dump_dwarf_section (bfd *abfd, asection *section,
       }
 }
 
+static const char *mach_o_dwarf_sections [] = {
+  "LC_SEGMENT.__DWARFA.__debug_abbrev",                /* .debug_abbrev */
+  "LC_SEGMENT.__DWARFA.__debug_aranges",       /* .debug_aranges */
+  "LC_SEGMENT.__DWARFA.__debug_frame",         /* .debug_frame */
+  "LC_SEGMENT.__DWARFA.__debug_info",          /* .debug_info */
+  "LC_SEGMENT.__DWARFA.__debug_line",          /* .debug_line */
+  "LC_SEGMENT.__DWARFA.__debug_pubnames",      /* .debug_pubnames */
+  ".eh_frame",                                 /* .eh_frame */
+  "LC_SEGMENT.__DWARFA.__debug_macinfo",       /* .debug_macinfo */
+  "LC_SEGMENT.__DWARFA.__debug_str",           /* .debug_str */
+  "LC_SEGMENT.__DWARFA.__debug_loc",           /* .debug_loc */
+  "LC_SEGMENT.__DWARFA.__debug_pubtypes",      /* .debug_pubtypes */
+  "LC_SEGMENT.__DWARFA.__debug_ranges",                /* .debug_ranges */
+  "LC_SEGMENT.__DWARFA.__debug_static_func",   /* .debug_static_func */
+  "LC_SEGMENT.__DWARFA.__debug_static_vars",   /* .debug_static_vars */
+  "LC_SEGMENT.__DWARFA.__debug_types",         /* .debug_types */
+  "LC_SEGMENT.__DWARFA.__debug_weaknames"      /* .debug_weaknames */
+};
+
+static const char *generic_dwarf_sections [max];
+
+static void
+check_mach_o_dwarf (bfd *abfd)
+{
+  static enum bfd_flavour old_flavour = bfd_target_unknown_flavour;
+  enum bfd_flavour current_flavour = bfd_get_flavour (abfd);
+  enum dwarf_section_display_enum i;
+
+  if (generic_dwarf_sections [0] == NULL)
+    for (i = 0; i < max; i++)
+      generic_dwarf_sections [i] = debug_displays[i].section.name;
+
+  if (old_flavour != current_flavour)
+    {
+      if (current_flavour == bfd_target_mach_o_flavour)
+       for (i = 0; i < max; i++)
+         debug_displays[i].section.name = mach_o_dwarf_sections [i];
+      else if (old_flavour == bfd_target_mach_o_flavour)
+       for (i = 0; i < max; i++)
+         debug_displays[i].section.name = generic_dwarf_sections [i];
+
+      old_flavour = current_flavour;
+    }
+}
+
 /* Dump the dwarf debugging information.  */
 
 static void
@@ -2074,6 +2120,8 @@ dump_dwarf (bfd *abfd)
   else
     abort ();
 
+  check_mach_o_dwarf (abfd);
+
   bfd_map_over_sections (abfd, dump_dwarf_section, NULL);
 
   free_debug_memory ();
@@ -2936,6 +2984,8 @@ main (int argc, char **argv)
 
   START_PROGRESS (program_name, 0);
 
+  expandargv (&argc, &argv);
+
   bfd_init ();
   set_default_bfd_target ();
 
This page took 0.022915 seconds and 4 git commands to generate.