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 { |