Index: lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp =================================================================== --- lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp +++ lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp @@ -252,10 +252,10 @@ return got->second; } - /// \brief Create a GOT TPREL entry and change the relocation to a PC32 to - /// the GOT. + /// \brief Create a GOT TPREL entry to local or external TLS variable. std::error_code handleGOTTPREL(const Reference &ref) { - if (isa(ref.target())) + if (isa(ref.target()) || + isa(ref.target())) const_cast(ref).setTarget(getGOTTPREL(ref.target())); return std::error_code(); }