aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-05-17 08:39:22 +0000
committerNick Clifton <nickc@redhat.com>2007-05-17 08:39:22 +0000
commitd57376011b9acb9da353056101933cefde39be3b (patch)
tree65ce69535641a95298156c493899f796d725fd07 /binutils
parent5e29c2647ad6277ec3cf70fb849b27dbeaa2f220 (diff)
downloadgdb-d57376011b9acb9da353056101933cefde39be3b.zip
gdb-d57376011b9acb9da353056101933cefde39be3b.tar.gz
gdb-d57376011b9acb9da353056101933cefde39be3b.tar.bz2
* objdump.c (load_debug_section): Select bias for DWARF debug addresses based on the flavour of the bfd.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objdump.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6affdfd..f364cca 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-17 Nick Clifton <nickc@redhat.com>
+
+ * objdump.c (load_debug_section): Select bias for DWARF debug
+ addresses based on the flavour of the bfd.
+
2007-05-11 Alan Modra <amodra@bigpond.net.au>
PR 4479
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 63480af..8927151 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -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);