From 0bc964fc7982793fd7d54dd6017774db1a19e3c6 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 17 Apr 2012 02:10:39 +0000 Subject: 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. --- gold/ChangeLog | 3 +++ gold/gdb-index.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 51779fb..c9bfd79 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,8 @@ 2012-04-16 David S. Miller + * 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. diff --git a/gold/gdb-index.cc b/gold/gdb-index.cc index 16e3871..07ba2ab 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; } -- cgit v1.1