This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix gold sparc SIGBUS


I wonder if anyone has been running the gold testsuite on sparc
lately, there are a lot of failures. :-) I'll see how many I can fix.

Ok to apply?

gold/

2011-09-09  David S. Miller  <davem@davemloft.net>

	* output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
	(Output_fill_debug_line::do_write): Likewise.

diff --git a/gold/output.cc b/gold/output.cc
index 9bf6a42..29d8e3d 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1961,15 +1961,15 @@ Output_fill_debug_info::do_write(Output_file* of, off_t off, size_t len) const
   // address_size.
   if (this->is_big_endian())
     {
-      elfcpp::Swap<32, true>::writeval(pov, len - 4);
-      elfcpp::Swap<16, true>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, true>::writeval(pov + 6, 0);
+      elfcpp::Swap_unaligned<32, true>::writeval(pov, len - 4);
+      elfcpp::Swap_unaligned<16, true>::writeval(pov + 4, this->version);
+      elfcpp::Swap_unaligned<32, true>::writeval(pov + 6, 0);
     }
   else
     {
-      elfcpp::Swap<32, false>::writeval(pov, len - 4);
-      elfcpp::Swap<16, false>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, false>::writeval(pov + 6, 0);
+      elfcpp::Swap_unaligned<32, false>::writeval(pov, len - 4);
+      elfcpp::Swap_unaligned<16, false>::writeval(pov + 4, this->version);
+      elfcpp::Swap_unaligned<32, false>::writeval(pov + 6, 0);
     }
   pov += 4 + 2 + 4;
   *pov++ = 4;
@@ -2021,15 +2021,15 @@ Output_fill_debug_line::do_write(Output_file* of, off_t off, size_t len) const
   // line number program is empty.
   if (this->is_big_endian())
     {
-      elfcpp::Swap<32, true>::writeval(pov, len - 4);
-      elfcpp::Swap<16, true>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, true>::writeval(pov + 6, len - (4 + 2 + 4));
+      elfcpp::Swap_unaligned<32, true>::writeval(pov, len - 4);
+      elfcpp::Swap_unaligned<16, true>::writeval(pov + 4, this->version);
+      elfcpp::Swap_unaligned<32, true>::writeval(pov + 6, len - (4 + 2 + 4));
     }
   else
     {
-      elfcpp::Swap<32, false>::writeval(pov, len - 4);
-      elfcpp::Swap<16, false>::writeval(pov + 4, this->version);
-      elfcpp::Swap<32, false>::writeval(pov + 6, len - (4 + 2 + 4));
+      elfcpp::Swap_unaligned<32, false>::writeval(pov, len - 4);
+      elfcpp::Swap_unaligned<16, false>::writeval(pov + 4, this->version);
+      elfcpp::Swap_unaligned<32, false>::writeval(pov + 6, len - (4 + 2 + 4));
     }
   pov += 4 + 2 + 4;
   *pov++ = 1;	// minimum_instruction_length


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]