Index: lld/trunk/ELF/OutputSections.h =================================================================== --- lld/trunk/ELF/OutputSections.h +++ lld/trunk/ELF/OutputSections.h @@ -36,10 +36,6 @@ template class ObjectFile; template class DefinedRegular; -// Flag to force GOT to be in output if we have relocations -// that relies on its address. -extern bool HasGotOffRel; - template static inline typename llvm::object::ELFFile::uintX_t getAddend(const typename llvm::object::ELFFile::Elf_Rel &Rel) { Index: lld/trunk/ELF/OutputSections.cpp =================================================================== --- lld/trunk/ELF/OutputSections.cpp +++ lld/trunk/ELF/OutputSections.cpp @@ -23,8 +23,6 @@ using namespace lld; using namespace lld::elf2; -bool elf2::HasGotOffRel = false; - template OutputSectionBase::OutputSectionBase(StringRef Name, uint32_t Type, uintX_t Flags) Index: lld/trunk/ELF/Writer.cpp =================================================================== --- lld/trunk/ELF/Writer.cpp +++ lld/trunk/ELF/Writer.cpp @@ -95,6 +95,10 @@ uintX_t SectionHeaderOff; llvm::StringMap InputToOutputSection; + + // Flag to force GOT to be in output if we have relocations + // that relies on its address. + bool HasGotOffRel = false; }; } // anonymous namespace