Index: lld/trunk/ELF/InputSection.h =================================================================== --- lld/trunk/ELF/InputSection.h +++ lld/trunk/ELF/InputSection.h @@ -84,7 +84,7 @@ typedef typename llvm::object::ELFFile::Elf_Shdr Elf_Shdr; public: - std::vector> Offsets; + std::vector> Offsets; MergeInputSection(ObjectFile *F, const Elf_Shdr *Header); static bool classof(const InputSectionBase *S); // Translate an offset in the input section to an offset in the output Index: lld/trunk/ELF/InputSection.cpp =================================================================== --- lld/trunk/ELF/InputSection.cpp +++ lld/trunk/ELF/InputSection.cpp @@ -164,7 +164,7 @@ // Find the element this offset points to. auto I = std::upper_bound( this->Offsets.begin(), this->Offsets.end(), Offset, - [](const uintX_t &A, const std::pair &B) { + [](const uintX_t &A, const std::pair &B) { return A < B.first; }); size_t End = I == this->Offsets.end() ? Data.size() : I->first; @@ -173,8 +173,8 @@ // Compute the Addend and if the Base is cached, return. uintX_t Addend = Offset - Start; - uintX_t &Base = I->second; - if (Base != uintX_t(-1)) + size_t &Base = I->second; + if (Base != size_t(-1)) return Base + Addend; // Map the base to the offset in the output section and cashe it.