Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: src/IceELFObjectWriter.cpp

Issue 889613004: Track undefined sym in the symtab. Remove hack for missing relocs against undef. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: separate asserts Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceELFObjectWriter.h ('k') | src/IceELFSection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFObjectWriter.cpp
diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp
index 7fcb0432eccfa37c4e5d6e444678568436f8cc24..c428c12b6ec7c49c45dc0d85860834624826c619 100644
--- a/src/IceELFObjectWriter.cpp
+++ b/src/IceELFObjectWriter.cpp
@@ -532,12 +532,23 @@ void ELFObjectWriter::writeAllRelocationSections(bool IsELF64) {
writeRelocationSections(IsELF64, RelRODataSections);
}
+void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) {
+ for (const Constant *S : UndefSyms) {
+ const auto Sym = llvm::cast<ConstantRelocatable>(S);
+ IceString Name = Sym->getName();
+ assert(Sym->getOffset() == 0);
+ assert(Sym->getSuppressMangling());
+ SymTab->noteUndefinedSym(Name, NullSection);
+ StrTab->add(Name);
+ }
+}
+
void ELFObjectWriter::writeRelocationSections(bool IsELF64,
RelSectionList &RelSections) {
for (ELFRelocationSection *RelSec : RelSections) {
Elf64_Off Offset = alignFileOffset(RelSec->getSectionAlign());
RelSec->setFileOffset(Offset);
- RelSec->setSize(RelSec->getSectionDataSize(Ctx, SymTab));
+ RelSec->setSize(RelSec->getSectionDataSize());
if (IsELF64) {
RelSec->writeData<true>(Ctx, Str, SymTab);
} else {
« no previous file with comments | « src/IceELFObjectWriter.h ('k') | src/IceELFSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698