Fix bug when applying R_SPARC_GOTDATA_OP* relocations to local symbols.
authorCary Coutant <ccoutant@gmail.com>
Tue, 6 Oct 2015 21:43:49 +0000 (14:43 -0700)
committerCary Coutant <ccoutant@gmail.com>
Tue, 6 Oct 2015 21:44:10 +0000 (14:44 -0700)
commit9eacb935acd69f6532135ec1353630db5111467c
tree5a40ad555d9ab1241c1e0c20884eda83b6f0feba
parent8c6da3dfbc65354975680bf7d8e273dbdca5de87
Fix bug when applying R_SPARC_GOTDATA_OP* relocations to local symbols.

When applying a GOTDATA_OP* relocation to a local symbol, the addend
is being applied after getting the value of the symbol. When the
relocation refers to a merge section, however, the addend must be
provided when computing the symbol value, since the contents of
the section may have been rearranged.

gold/
PR gold/18855
* sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
parameter.
(Sparc_relocate_functions::gdop_lox10): Likewise.
(Target_sparc::Relocate::relocate): Use addend when computing
symbol value for R_SPARC_GOTDATA_OP*.
gold/ChangeLog
gold/sparc.cc