From b289257c7f3ed78b7d3971c596d7c60a9050c705 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 13 Jan 2016 20:06:04 +0000 Subject: Vendor import of lld trunk r257626: https://llvm.org/svn/llvm-project/lld/trunk@257626 --- ELF/InputFiles.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ELF/InputFiles.cpp') diff --git a/ELF/InputFiles.cpp b/ELF/InputFiles.cpp index d9df6abbf2333..6a908d450f602 100644 --- a/ELF/InputFiles.cpp +++ b/ELF/InputFiles.cpp @@ -92,7 +92,9 @@ typename ObjectFile::Elf_Sym_Range ObjectFile::getLocalSymbols() { } template uint32_t ObjectFile::getMipsGp0() const { - return MipsReginfo ? MipsReginfo->getGp0() : 0; + if (MipsReginfo) + return MipsReginfo->Reginfo->ri_gp_value; + return 0; } template @@ -132,13 +134,13 @@ StringRef ObjectFile::getShtGroupSignature(const Elf_Shdr &Sec) { } template -ArrayRef::GroupEntryType> +ArrayRef::uint32_X> ObjectFile::getShtGroupEntries(const Elf_Shdr &Sec) { const ELFFile &Obj = this->ELFObj; - ErrorOr> EntriesOrErr = - Obj.template getSectionContentsAsArray(&Sec); + ErrorOr> EntriesOrErr = + Obj.template getSectionContentsAsArray(&Sec); error(EntriesOrErr); - ArrayRef Entries = *EntriesOrErr; + ArrayRef Entries = *EntriesOrErr; if (Entries.empty() || Entries[0] != GRP_COMDAT) error("Unsupported SHT_GROUP format"); return Entries.slice(1); @@ -187,8 +189,7 @@ void ObjectFile::initializeSections(DenseSet &ComdatGroups) { Sections[I] = &InputSection::Discarded; if (ComdatGroups.insert(getShtGroupSignature(Sec)).second) continue; - for (GroupEntryType E : getShtGroupEntries(Sec)) { - uint32_t SecIndex = E; + for (uint32_t SecIndex : getShtGroupEntries(Sec)) { if (SecIndex >= Size) error("Invalid section index in group"); Sections[SecIndex] = &InputSection::Discarded; -- cgit v1.2.3