public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix GOLD SIGBUS on 64-bit sparc
@ 2012-04-12  7:37 David Miller
  2012-04-17  0:30 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2012-04-12  7:37 UTC (permalink / raw)
  To: binutils


The 64-bit fields of these range blobs emitted by the gdb-index code
are not aligned.

gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
	writing out 64-bit part of ranges.

diff --git a/gold/gdb-index.cc b/gold/gdb-index.cc
index 11b732a..3a959e4 100644
--- a/gold/gdb-index.cc
+++ b/gold/gdb-index.cc
@@ -1166,8 +1166,8 @@ Gdb_index::do_write(Output_file* of)
 	      base = (os->address()
 		      + object->output_section_offset(range.shndx));
 	    }
-	  elfcpp::Swap<64, false>::writeval(pov, base + range.start);
-	  elfcpp::Swap<64, false>::writeval(pov + 8, base + range.end);
+	  elfcpp::Swap_unaligned<64, false>::writeval(pov, base + range.start);
+	  elfcpp::Swap_unaligned<64, false>::writeval(pov + 8, base + range.end);
 	  elfcpp::Swap<32, false>::writeval(pov + 16, cu_index);
 	  pov += 20;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix GOLD SIGBUS on 64-bit sparc
  2012-04-12  7:37 [PATCH] Fix GOLD SIGBUS on 64-bit sparc David Miller
@ 2012-04-17  0:30 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2012-04-17  0:30 UTC (permalink / raw)
  To: David Miller; +Cc: binutils

David Miller <davem@davemloft.net> writes:

> gold/
>
> 	* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
> 	writing out 64-bit part of ranges.

This is OK.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-17  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12  7:37 [PATCH] Fix GOLD SIGBUS on 64-bit sparc David Miller
2012-04-17  0:30 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).