Chromium Code Reviews| Index: src/IceELFObjectWriter.cpp |
| diff --git a/src/IceELFObjectWriter.cpp b/src/IceELFObjectWriter.cpp |
| index d15c735edf96c83028bb06c04f0f50c56cdb1cd8..980030be10f0ba859e1223a4f7696101b85e13de 100644 |
| --- a/src/IceELFObjectWriter.cpp |
| +++ b/src/IceELFObjectWriter.cpp |
| @@ -533,12 +533,22 @@ 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(); |
|
Jim Stichnoth
2015/02/01 03:23:55
The fact that this is IceString instead of IceStri
jvoung (off chromium)
2015/02/01 17:07:56
Hmm I can check if they can be converted to return
|
| + assert(Sym->getOffset() == 0 && Sym->getSuppressMangling()); |
|
Jim Stichnoth
2015/02/01 03:23:55
I realize there are "violations" elsewhere, but I
jvoung (off chromium)
2015/02/01 17:07:56
Oops done.
|
| + 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 { |