* dwarf2.c (read_rangelist): Use read_address to read low_pc and
authorAdam Nemet <anemet@caviumnetworks.com>
Fri, 30 Jan 2009 01:04:47 +0000 (01:04 +0000)
committerAdam Nemet <anemet@caviumnetworks.com>
Fri, 30 Jan 2009 01:04:47 +0000 (01:04 +0000)
high_pc in order to properly sign-extend VMAs.

bfd/ChangeLog
bfd/dwarf2.c

index cdf1a5d0bfeb7b0fa46e7a06550c38ec2918e1ad..16f061d77ebeb49287f862bd00c73f3dc376b46b 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * dwarf2.c (read_rangelist): Use read_address to read low_pc and
+       high_pc in order to properly sign-extend VMAs.
+
 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
             Mark Shinwell  <shinwell@codesourcery.com>
             Catherine Moore  <clm@codesourcery.com>
index 4f2e38c52846f5e35daa545120588a289e200394..0c18253405092ef61f914aa3ac2d65b08db8f350 100644 (file)
@@ -1803,20 +1803,11 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
       bfd_vma low_pc;
       bfd_vma high_pc;
 
-      if (unit->addr_size == 4)
-       {
-         low_pc = read_4_bytes (unit->abfd, ranges_ptr);
-         ranges_ptr += 4;
-         high_pc = read_4_bytes (unit->abfd, ranges_ptr);
-         ranges_ptr += 4;
-       }
-      else
-       {
-         low_pc = read_8_bytes (unit->abfd, ranges_ptr);
-         ranges_ptr += 8;
-         high_pc = read_8_bytes (unit->abfd, ranges_ptr);
-         ranges_ptr += 8;
-       }
+      low_pc = read_address (unit, ranges_ptr);
+      ranges_ptr += unit->addr_size;
+      high_pc = read_address (unit, ranges_ptr);
+      ranges_ptr += unit->addr_size;
+
       if (low_pc == 0 && high_pc == 0)
        break;
       if (low_pc == -1UL && high_pc != -1UL)