diff options
author | Alan Modra <amodra@gmail.com> | 2015-01-29 20:33:26 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-01-29 20:34:45 +1030 |
commit | 0f81d3f0a799c6e8c2a89d7f519916e3c9c0f65e (patch) | |
tree | 439383bf93d2dad21cae94fd28212f00f0246835 /gold/powerpc.cc | |
parent | ea16498d5a740e2888feb2f8bce92d9565baf244 (diff) | |
download | gdb-0f81d3f0a799c6e8c2a89d7f519916e3c9c0f65e.zip gdb-0f81d3f0a799c6e8c2a89d7f519916e3c9c0f65e.tar.gz gdb-0f81d3f0a799c6e8c2a89d7f519916e3c9c0f65e.tar.bz2 |
Correct GOLD PowerPC64 local-dynamic TLS linker optimization
Similar to b86ac8e3
* powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
and GOT_TLSGD to LE optimization.
Diffstat (limited to 'gold/powerpc.cc')
-rw-r--r-- | gold/powerpc.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 2eae938..ac8d05b 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -3178,8 +3178,6 @@ static const uint32_t addi_11_11 = 0x396b0000; static const uint32_t addi_12_12 = 0x398c0000; static const uint32_t addis_0_2 = 0x3c020000; static const uint32_t addis_0_13 = 0x3c0d0000; -static const uint32_t addis_3_2 = 0x3c620000; -static const uint32_t addis_3_13 = 0x3c6d0000; static const uint32_t addis_11_2 = 0x3d620000; static const uint32_t addis_11_11 = 0x3d6b0000; static const uint32_t addis_11_30 = 0x3d7e0000; @@ -7008,9 +7006,12 @@ Target_powerpc<size, big_endian>::Relocate::relocate( || r_type == elfcpp::R_POWERPC_GOT_TLSGD16_LO) { Insn* iview = reinterpret_cast<Insn*>(view - 2 * big_endian); - Insn insn = addis_3_13; + Insn insn = elfcpp::Swap<32, big_endian>::readval(iview); + insn &= (1 << 26) - (1 << 21); // extract rt if (size == 32) - insn = addis_3_2; + insn |= addis_0_2; + else + insn |= addis_0_13; elfcpp::Swap<32, big_endian>::writeval(iview, insn); r_type = elfcpp::R_POWERPC_TPREL16_HA; value = psymval->value(object, rela.get_r_addend()); @@ -7043,9 +7044,12 @@ Target_powerpc<size, big_endian>::Relocate::relocate( || r_type == elfcpp::R_POWERPC_GOT_TLSLD16_LO) { Insn* iview = reinterpret_cast<Insn*>(view - 2 * big_endian); - Insn insn = addis_3_13; + Insn insn = elfcpp::Swap<32, big_endian>::readval(iview); + insn &= (1 << 26) - (1 << 21); // extract rt if (size == 32) - insn = addis_3_2; + insn |= addis_0_2; + else + insn |= addis_0_13; elfcpp::Swap<32, big_endian>::writeval(iview, insn); r_type = elfcpp::R_POWERPC_TPREL16_HA; value = dtp_offset; |