gold: Fix 64-bit sparc GOLD crash in gdb-index code.

gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
	writing out 64-bit part of ranges.
This commit is contained in:
David S. Miller 2012-04-17 02:10:39 +00:00
parent 661d7a80a2
commit 0bc964fc79
2 changed files with 5 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2012-04-16 David S. Miller <davem@davemloft.net>
* gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
writing out 64-bit part of ranges.
* Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
-fpic and -fpie respectively.
* Makefile.in: Regenerate.

View file

@ -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;
}