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 /// \file | 10 /// \file |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 598 |
599 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) { | 599 void ELFObjectWriter::setUndefinedSyms(const ConstantList &UndefSyms) { |
600 for (const Constant *S : UndefSyms) { | 600 for (const Constant *S : UndefSyms) { |
601 const auto Sym = llvm::cast<ConstantRelocatable>(S); | 601 const auto Sym = llvm::cast<ConstantRelocatable>(S); |
602 const IceString &Name = Sym->getName(); | 602 const IceString &Name = Sym->getName(); |
603 bool BadIntrinsic; | 603 bool BadIntrinsic; |
604 const Intrinsics::FullIntrinsicInfo *Info = | 604 const Intrinsics::FullIntrinsicInfo *Info = |
605 Ctx.getIntrinsicsInfo().find(Name, BadIntrinsic); | 605 Ctx.getIntrinsicsInfo().find(Name, BadIntrinsic); |
606 if (Info) | 606 if (Info) |
607 continue; | 607 continue; |
608 assert(!BadIntrinsic); | 608 // Ignore BadIntrinsic, which is set if the name begins with "llvm." but |
| 609 // doesn't match a known intrinsic. If we want this to turn into an error, |
| 610 // we should catch it early on. |
609 assert(Sym->getOffset() == 0); | 611 assert(Sym->getOffset() == 0); |
610 assert(Sym->getSuppressMangling()); | 612 assert(Sym->getSuppressMangling()); |
611 SymTab->noteUndefinedSym(Name, NullSection); | 613 SymTab->noteUndefinedSym(Name, NullSection); |
612 StrTab->add(Name); | 614 StrTab->add(Name); |
613 } | 615 } |
614 } | 616 } |
615 | 617 |
616 void ELFObjectWriter::writeRelocationSections(RelSectionList &RelSections) { | 618 void ELFObjectWriter::writeRelocationSections(RelSectionList &RelSections) { |
617 for (ELFRelocationSection *RelSec : RelSections) { | 619 for (ELFRelocationSection *RelSec : RelSections) { |
618 Elf64_Off Offset = alignFileOffset(RelSec->getSectionAlign()); | 620 Elf64_Off Offset = alignFileOffset(RelSec->getSectionAlign()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 if (ELF64) { | 671 if (ELF64) { |
670 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), | 672 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), |
671 AllSections.size()); | 673 AllSections.size()); |
672 } else { | 674 } else { |
673 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), | 675 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), |
674 AllSections.size()); | 676 AllSections.size()); |
675 } | 677 } |
676 } | 678 } |
677 | 679 |
678 } // end of namespace Ice | 680 } // end of namespace Ice |
OLD | NEW |