diff options
author | Paul Koning <pkoning@equallogic.com> | 2005-07-08 21:42:33 +0000 |
---|---|---|
committer | Paul Koning <pkoning@equallogic.com> | 2005-07-08 21:42:33 +0000 |
commit | 0af4cd7c6076b20783883130b2d999d4f8bf4373 (patch) | |
tree | 9984eeae86958422ef1aca1369902615f27ba889 /bfd/dwarf2.c | |
parent | efd3631498cf717a4c28b0a4ad73f33d3cb66a28 (diff) | |
download | ppe42-binutils-0af4cd7c6076b20783883130b2d999d4f8bf4373.tar.gz ppe42-binutils-0af4cd7c6076b20783883130b2d999d4f8bf4373.zip |
2005-07-08 Paul Koning <pkoning@equallogic.com>
* dwarf2.c (read_address): Check sign_extend_vma to handle targets
where addresses are sign extended.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r-- | bfd/dwarf2.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index d65fb68938..40883dd09e 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -347,16 +347,35 @@ read_indirect_string (struct comp_unit* unit, static bfd_uint64_t read_address (struct comp_unit *unit, bfd_byte *buf) { - switch (unit->addr_size) + int signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma; + + if (signed_vma) { - case 8: - return bfd_get_64 (unit->abfd, buf); - case 4: - return bfd_get_32 (unit->abfd, buf); - case 2: - return bfd_get_16 (unit->abfd, buf); - default: - abort (); + switch (unit->addr_size) + { + case 8: + return bfd_get_signed_64 (unit->abfd, buf); + case 4: + return bfd_get_signed_32 (unit->abfd, buf); + case 2: + return bfd_get_signed_16 (unit->abfd, buf); + default: + abort (); + } + } + else + { + switch (unit->addr_size) + { + case 8: + return bfd_get_64 (unit->abfd, buf); + case 4: + return bfd_get_32 (unit->abfd, buf); + case 2: + return bfd_get_16 (unit->abfd, buf); + default: + abort (); + } } } |