]> Git Repo - binutils.git/commitdiff
* objdump.c (load_debug_section): Select bias for DWARF debug addresses based on...
authorNick Clifton <[email protected]>
Thu, 17 May 2007 08:39:22 +0000 (08:39 +0000)
committerNick Clifton <[email protected]>
Thu, 17 May 2007 08:39:22 +0000 (08:39 +0000)
binutils/ChangeLog
binutils/objdump.c

index 6affdfdff04a92f4129180e9fb31af13ed22c55e..f364cca0199933947065df978e471628d65e1178 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-17  Nick Clifton  <[email protected]>
+
+       * objdump.c (load_debug_section): Select bias for DWARF debug
+       addresses based on the flavour of the bfd.
+
 2007-05-11  Alan Modra  <[email protected]>
 
        PR 4479
index 63480afce14e45fcd2e9f3a2278271375d992686..8927151affb3e9dc66338dfba8103dd3155a53d5 100644 (file)
@@ -1974,7 +1974,19 @@ load_debug_section (enum dwarf_section_display_enum debug, void *file)
   if (sec == NULL)
     return 0;
 
-  section->address = bfd_get_section_vma (abfd, sec);
+  /* Compute a bias to be added to offsets found within the DWARF debug
+     information.  These offsets are meant to be relative to the start of
+     the dwarf section, and hence the bias should be 0.  For MACH-O however
+     a dwarf section is really just a region of a much larger section and so
+     the bias is the address of the start of that area within the larger
+     section.  This test is important for PE and COFF based targets which
+     use DWARF debug information, since unlike ELF, they do not allow the
+     dwarf sections to be placed at address 0.  */
+  if (bfd_get_flavour (abfd) == bfd_target_mach_o_flavour)
+    section->address = bfd_get_section_vma (abfd, sec);
+  else
+    section->address = 0;
+    
   section->size = bfd_get_section_size (sec);
   section->start = xmalloc (section->size);
 
This page took 0.033248 seconds and 4 git commands to generate.