diff options
Diffstat (limited to 'llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp index 50a59ce76763..ddc62b534598 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp @@ -41,8 +41,6 @@ namespace { bool needsRelocateWithSymbol(const MCValue &Val, const MCSymbol &Sym, unsigned Type) const override; - - void addTargetSectionFlags(MCContext &Ctx, MCSectionELF &Sec) override; }; } // end anonymous namespace @@ -319,25 +317,6 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target, } } -void ARMELFObjectWriter::addTargetSectionFlags(MCContext &Ctx, - MCSectionELF &Sec) { - // The mix of execute-only and non-execute-only at link time is - // non-execute-only. To avoid the empty implicitly created .text - // section from making the whole .text section non-execute-only, we - // mark it execute-only if it is empty and there is at least one - // execute-only section in the object. - MCSectionELF *TextSection = - static_cast<MCSectionELF *>(Ctx.getObjectFileInfo()->getTextSection()); - bool IsExecOnly = Sec.getFlags() & ELF::SHF_ARM_PURECODE; - if (IsExecOnly && !TextSection->hasInstructions()) { - for (auto &F : *TextSection) - if (auto *DF = dyn_cast<MCDataFragment>(&F)) - if (!DF->getContents().empty()) - return; - TextSection->setFlags(TextSection->getFlags() | ELF::SHF_ARM_PURECODE); - } -} - std::unique_ptr<MCObjectTargetWriter> llvm::createARMELFObjectWriter(uint8_t OSABI) { return std::make_unique<ARMELFObjectWriter>(OSABI); |
