* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
authorDavid S. Miller <davem@redhat.com>
Thu, 3 Apr 2008 04:18:53 +0000 (04:18 +0000)
committerDavid S. Miller <davem@redhat.com>
Thu, 3 Apr 2008 04:18:53 +0000 (04:18 +0000)
Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.

gold/ChangeLog
gold/dwarf_reader.cc

index 5bdf106c71eebdc1e7c392973ac57cbffc29bd7e..53b055fd2f710f45fdb9f4e0b5c1edde56b7dbdd 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-02  David S. Miller  <davem@davemloft.net>
+
+       *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
+       Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
+
 2008-04-02  Craig Silverstein  <csilvers@google.com>
 
        * TODO: New file.
index 7ce6c7effe28ffa5dad51deac22653fac43165a3..e345ff8eccf8b90ca93053375458f4f9d2a8aa60 100644 (file)
@@ -185,7 +185,7 @@ const unsigned char*
 Sized_dwarf_line_info<size, big_endian>::read_header_prolog(
     const unsigned char* lineptr)
 {
-  uint32_t initial_length = elfcpp::Swap<32, big_endian>::readval(lineptr);
+  uint32_t initial_length = elfcpp::Swap_unaligned<32, big_endian>::readval(lineptr);
   lineptr += 4;
 
   // In DWARF2/3, if the initial length is all 1 bits, then the offset
@@ -193,7 +193,7 @@ Sized_dwarf_line_info<size, big_endian>::read_header_prolog(
   if (initial_length == 0xffffffff)
     {
       header_.offset_size = 8;
-      initial_length = elfcpp::Swap<64, big_endian>::readval(lineptr);
+      initial_length = elfcpp::Swap_unaligned<64, big_endian>::readval(lineptr);
       lineptr += 8;
     }
   else
@@ -203,13 +203,13 @@ Sized_dwarf_line_info<size, big_endian>::read_header_prolog(
 
   gold_assert(lineptr + header_.total_length <= buffer_end_);
 
-  header_.version = elfcpp::Swap<16, big_endian>::readval(lineptr);
+  header_.version = elfcpp::Swap_unaligned<16, big_endian>::readval(lineptr);
   lineptr += 2;
 
   if (header_.offset_size == 4)
-    header_.prologue_length = elfcpp::Swap<32, big_endian>::readval(lineptr);
+    header_.prologue_length = elfcpp::Swap_unaligned<32, big_endian>::readval(lineptr);
   else
-    header_.prologue_length = elfcpp::Swap<64, big_endian>::readval(lineptr);
+    header_.prologue_length = elfcpp::Swap_unaligned<64, big_endian>::readval(lineptr);
   lineptr += header_.offset_size;
 
   header_.min_insn_length = *lineptr;
@@ -394,7 +394,7 @@ Sized_dwarf_line_info<size, big_endian>::process_one_opcode(
     case elfcpp::DW_LNS_fixed_advance_pc:
       {
         int advance_address;
-        advance_address = elfcpp::Swap<16, big_endian>::readval(start);
+        advance_address = elfcpp::Swap_unaligned<16, big_endian>::readval(start);
         oplen += 2;
         lsm->address += advance_address;
       }
@@ -432,7 +432,7 @@ Sized_dwarf_line_info<size, big_endian>::process_one_opcode(
 
           case elfcpp::DW_LNE_set_address:
             {
-              lsm->address = elfcpp::Swap<size, big_endian>::readval(start);
+              lsm->address = elfcpp::Swap_unaligned<size, big_endian>::readval(start);
               typename Reloc_map::const_iterator it
                   = reloc_map_.find(start - this->buffer_);
               if (it != reloc_map_.end())