diff options
author | Carlos O'Donell <carlos@codesourcery.com> | 2007-02-23 17:38:07 +0000 |
---|---|---|
committer | Carlos O'Donell <carlos@codesourcery.com> | 2007-02-23 17:38:07 +0000 |
commit | 024b2372f5188ed4d7cd9ee5383594063a54cc93 (patch) | |
tree | bd7c5e7647fd1f1f5ef13735063fc535e563dfbe /bfd | |
parent | cb3ff1e5f7ae427416d18ea83634cf201068eb5f (diff) | |
download | gdb-024b2372f5188ed4d7cd9ee5383594063a54cc93.zip gdb-024b2372f5188ed4d7cd9ee5383594063a54cc93.tar.gz gdb-024b2372f5188ed4d7cd9ee5383594063a54cc93.tar.bz2 |
bfd/
2007-02-23 Carlos O'Donell <carlos@codesourcery.com>
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit
DWARF even with 64-bit addresses.
(_bfd_dwarf2_find_nearest_line): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/dwarf2.c | 32 |
2 files changed, 28 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7b35206..adde103 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2007-02-23 Carlos O'Donell <carlos@codesourcery.com> + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit + DWARF even with 64-bit addresses. + (_bfd_dwarf2_find_nearest_line): Likewise. + 2007-02-23 Nick Clifton <nickc@redhat.com> PR binutils/3535 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 059e903..119689b 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2469,13 +2469,19 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, length = read_4_bytes (abfd, stash->info_ptr + 4); stash->info_ptr += 8; } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ + /* In the absence of the hints above, we assume 32-bit DWARF2 + offsets even for targets with 64-bit addresses, because: + a) most of the time these targets will not have generated + more than 2Gb of debug info and so will not need 64-bit + offsets, + and + b) if they do use 64-bit offsets but they are not using + the size hints that are tested for above then they are + not conforming to the DWARF3 standard anyway. */ else if (addr_size == 8) { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; + offset_size = 4; + stash->info_ptr += 4; } else stash->info_ptr += 4; @@ -2692,13 +2698,19 @@ _bfd_dwarf2_find_line (bfd *abfd, length = read_4_bytes (abfd, stash->info_ptr + 4); stash->info_ptr += 8; } - /* In the absence of the hints above, we assume addr_size-sized - offsets, for backward-compatibility with pre-DWARF3 64-bit - platforms. */ + /* In the absence of the hints above, we assume 32-bit DWARF2 + offsets even for targets with 64-bit addresses, because: + a) most of the time these targets will not have generated + more than 2Gb of debug info and so will not need 64-bit + offsets, + and + b) if they do use 64-bit offsets but they are not using + the size hints that are tested for above then they are + not conforming to the DWARF3 standard anyway. */ else if (addr_size == 8) { - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += 8; + offset_size = 4; + stash->info_ptr += 4; } else stash->info_ptr += 4; |