summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-02-19 01:58:11 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-02-19 01:58:11 +0000
commit21aaf2534d6c953faf7ef10cdc8581cc2a89ff36 (patch)
tree4d2550500d13ae1ecea2d935784f2b7603db072e
parentb4a99d3194982a8f6117b241f92090a24eea9388 (diff)
downloadbcm5719-llvm-21aaf2534d6c953faf7ef10cdc8581cc2a89ff36.tar.gz
bcm5719-llvm-21aaf2534d6c953faf7ef10cdc8581cc2a89ff36.zip
Switch a vector<pair<const T &, const U &>> to a vector<pair<const T *,
const U *>>. Even in C++11 it doesn't seem this is valid as vector's emplace support requires move assignment, and there is no way to move assign a reference. The real motivation however is that this fixes the build of lld with libstdc++ 4.6. llvm-svn: 175481
-rw-r--r--lld/lib/ReaderWriter/ELF/SectionChunks.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.h b/lld/lib/ReaderWriter/ELF/SectionChunks.h
index 18d191b6810..1ee45244944 100644
--- a/lld/lib/ReaderWriter/ELF/SectionChunks.h
+++ b/lld/lib/ReaderWriter/ELF/SectionChunks.h
@@ -690,7 +690,7 @@ public:
}
void addRelocation(const DefinedAtom &da, const Reference &r) {
- _relocs.emplace_back(da, r);
+ _relocs.emplace_back(&da, &r);
this->_fsize = _relocs.size() * sizeof(Elf_Rela);
this->_msize = this->_fsize;
}
@@ -700,21 +700,21 @@ public:
uint8_t *dest = chunkBuffer + this->fileOffset();
for (const auto &rel : _relocs) {
Elf_Rela *r = reinterpret_cast<Elf_Rela *>(dest);
- r->setSymbolAndType(0, rel.second.kind());
+ r->setSymbolAndType(0, rel.second->kind());
r->r_offset =
- writer->addressOfAtom(&rel.first) + rel.second.offsetInAtom();
+ writer->addressOfAtom(rel.first) + rel.second->offsetInAtom();
r->r_addend =
- writer->addressOfAtom(rel.second.target()) + rel.second.addend();
+ writer->addressOfAtom(rel.second->target()) + rel.second->addend();
dest += sizeof(Elf_Rela);
DEBUG_WITH_TYPE("ELFRelocationTable", llvm::dbgs()
- << "IRELATIVE relocation at " << rel.first.name() << "@"
- << r->r_offset << " to " << rel.second.target()->name()
+ << "IRELATIVE relocation at " << rel.first->name() << "@"
+ << r->r_offset << " to " << rel.second->target()->name()
<< "@" << r->r_addend << "\n");
}
}
private:
- std::vector<std::pair<const DefinedAtom &, const Reference &>> _relocs;
+ std::vector<std::pair<const DefinedAtom *, const Reference *>> _relocs;
};
} // end namespace elf
} // end namespace lld
OpenPOWER on IntegriCloud