| OLD | NEW |
| 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// | 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines the writer for ELF relocatable object files. | 10 // This file defines the writer for ELF relocatable object files. |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 void ELFObjectWriter::writeAllRelocationSections(bool IsELF64) { | 535 void ELFObjectWriter::writeAllRelocationSections(bool IsELF64) { |
| 536 writeRelocationSections(IsELF64, RelTextSections); | 536 writeRelocationSections(IsELF64, RelTextSections); |
| 537 writeRelocationSections(IsELF64, RelDataSections); | 537 writeRelocationSections(IsELF64, RelDataSections); |
| 538 writeRelocationSections(IsELF64, RelRODataSections); | 538 writeRelocationSections(IsELF64, RelRODataSections); |
| 539 } | 539 } |
| 540 | 540 |
| 541 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) { | 541 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) { |
| 542 for (const Constant *S : UndefSyms) { | 542 for (const Constant *S : UndefSyms) { |
| 543 const auto Sym = llvm::cast<ConstantRelocatable>(S); | 543 const auto Sym = llvm::cast<ConstantRelocatable>(S); |
| 544 IceString Name = Sym->getName(); | 544 const IceString &Name = Sym->getName(); |
| 545 assert(Sym->getOffset() == 0); | 545 assert(Sym->getOffset() == 0); |
| 546 assert(Sym->getSuppressMangling()); | 546 assert(Sym->getSuppressMangling()); |
| 547 SymTab->noteUndefinedSym(Name, NullSection); | 547 SymTab->noteUndefinedSym(Name, NullSection); |
| 548 StrTab->add(Name); | 548 StrTab->add(Name); |
| 549 } | 549 } |
| 550 } | 550 } |
| 551 | 551 |
| 552 void ELFObjectWriter::writeRelocationSections(bool IsELF64, | 552 void ELFObjectWriter::writeRelocationSections(bool IsELF64, |
| 553 RelSectionList &RelSections) { | 553 RelSectionList &RelSections) { |
| 554 for (ELFRelocationSection *RelSec : RelSections) { | 554 for (ELFRelocationSection *RelSec : RelSections) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 if (IsELF64) { | 608 if (IsELF64) { |
| 609 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), | 609 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), |
| 610 AllSections.size()); | 610 AllSections.size()); |
| 611 } else { | 611 } else { |
| 612 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), | 612 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), |
| 613 AllSections.size()); | 613 AllSections.size()); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // end of namespace Ice | 617 } // end of namespace Ice |
| OLD | NEW |