From deae2a14a03a8cae07817ae03e4517fe4983d94e Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 3 Apr 2008 04:18:53 +0000 Subject: [PATCH] * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog, Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned. --- gold/ChangeLog | 5 +++++ gold/dwarf_reader.cc | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 5bdf106c71e..53b055fd2f7 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2008-04-02 David S. Miller + + * 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 * TODO: New file. diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 7ce6c7effe2..e345ff8eccf 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -185,7 +185,7 @@ const unsigned char* Sized_dwarf_line_info::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::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::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::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::process_one_opcode( case elfcpp::DW_LNE_set_address: { - lsm->address = elfcpp::Swap::readval(start); + lsm->address = elfcpp::Swap_unaligned::readval(start); typename Reloc_map::const_iterator it = reloc_map_.find(start - this->buffer_); if (it != reloc_map_.end()) -- 2.30.2