From: David S. Miller Date: Tue, 9 Feb 2010 04:48:16 +0000 (+0000) Subject: gold/ X-Git-Tag: gdb_7_1-2010-02-18-branchpoint~140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=705b5121210f15c53f33635ce27798024eb2ac3b;p=external%2Fbinutils.git gold/ 2010-02-08 David S. Miller * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned relocation helper function. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 0aac2be..b65da03 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2010-02-08 David S. Miller + + * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is + unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned + relocation helper function. + 2010-02-06 Ian Lance Taylor * configure.ac: Rewrite targetobjs duplicate removal code to use diff --git a/gold/sparc.cc b/gold/sparc.cc index c5ce06a..4cef8d86 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -2447,14 +2447,30 @@ Target_sparc::Relocate::relocate( break; case elfcpp::R_SPARC_16: - Relocate_functions::rela16(view, object, - psymval, addend); + if (rela.get_r_offset() & 0x1) + { + // The assembler can sometimes emit unaligned relocations + // for dwarf2 cfi directives. + Reloc::ua16(view, object, psymval, addend); + } + else + Relocate_functions::rela16(view, object, + psymval, addend); break; case elfcpp::R_SPARC_32: if (!parameters->options().output_is_position_independent()) - Relocate_functions::rela32(view, object, - psymval, addend); + { + if (rela.get_r_offset() & 0x3) + { + // The assembler can sometimes emit unaligned relocations + // for dwarf2 cfi directives. + Reloc::ua32(view, object, psymval, addend); + } + else + Relocate_functions::rela32(view, object, + psymval, addend); + } break; case elfcpp::R_SPARC_DISP8: @@ -2563,8 +2579,17 @@ Target_sparc::Relocate::relocate( case elfcpp::R_SPARC_64: if (!parameters->options().output_is_position_independent()) - Relocate_functions::rela64(view, object, - psymval, addend); + { + if (rela.get_r_offset() & 0x7) + { + // The assembler can sometimes emit unaligned relocations + // for dwarf2 cfi directives. + Reloc::ua64(view, object, psymval, addend); + } + else + Relocate_functions::rela64(view, object, + psymval, addend); + } break; case elfcpp::R_SPARC_OLO10: