forked from OSchip/llvm-project
Move getNonexecutableStackSection up to the base ELF class.
The .note.GNU-stack section is not SystemZ/X86 specific. llvm-svn: 219796
This commit is contained in:
parent
fb237520ee
commit
ad33dd2914
|
@ -15,6 +15,9 @@
|
|||
namespace llvm {
|
||||
class MCAsmInfoELF : public MCAsmInfo {
|
||||
virtual void anchor();
|
||||
const MCSection *
|
||||
getNonexecutableStackSection(MCContext &Ctx) const override final;
|
||||
|
||||
protected:
|
||||
MCAsmInfoELF();
|
||||
};
|
||||
|
|
|
@ -13,10 +13,19 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCSectionELF.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
using namespace llvm;
|
||||
|
||||
void MCAsmInfoELF::anchor() { }
|
||||
|
||||
const MCSection *
|
||||
MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
|
||||
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
|
||||
0, SectionKind::getMetadata());
|
||||
}
|
||||
|
||||
MCAsmInfoELF::MCAsmInfoELF() {
|
||||
HasIdentDirective = true;
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
|
|
@ -44,8 +44,3 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() {
|
|||
//===--- Dwarf Emission Directives -----------------------------------===//
|
||||
SupportsDebugInformation = true;
|
||||
}
|
||||
|
||||
const MCSection*
|
||||
AMDGPUMCAsmInfo::getNonexecutableStackSection(MCContext &CTX) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ class StringRef;
|
|||
class AMDGPUMCAsmInfo : public MCAsmInfoELF {
|
||||
public:
|
||||
explicit AMDGPUMCAsmInfo(StringRef &TT);
|
||||
const MCSection* getNonexecutableStackSection(MCContext &CTX) const override;
|
||||
};
|
||||
} // namespace llvm
|
||||
#endif
|
||||
|
|
|
@ -25,9 +25,3 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) {
|
|||
SupportsDebugInformation = true;
|
||||
ExceptionsType = ExceptionHandling::DwarfCFI;
|
||||
}
|
||||
|
||||
const MCSection *
|
||||
SystemZMCAsmInfo::getNonexecutableStackSection(MCContext &Ctx) const {
|
||||
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
|
||||
0, SectionKind::getMetadata());
|
||||
}
|
||||
|
|
|
@ -19,9 +19,6 @@ class StringRef;
|
|||
class SystemZMCAsmInfo : public MCAsmInfoELF {
|
||||
public:
|
||||
explicit SystemZMCAsmInfo(StringRef TT);
|
||||
|
||||
// Override MCAsmInfo;
|
||||
const MCSection *getNonexecutableStackSection(MCContext &Ctx) const override;
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
|
|
@ -130,12 +130,6 @@ X86_64MCAsmInfoDarwin::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
|||
return MCBinaryExpr::CreateAdd(Res, Four, Context);
|
||||
}
|
||||
|
||||
const MCSection *X86ELFMCAsmInfo::
|
||||
getNonexecutableStackSection(MCContext &Ctx) const {
|
||||
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
|
||||
0, SectionKind::getMetadata());
|
||||
}
|
||||
|
||||
void X86MCAsmInfoMicrosoft::anchor() { }
|
||||
|
||||
X86MCAsmInfoMicrosoft::X86MCAsmInfoMicrosoft(const Triple &Triple) {
|
||||
|
|
|
@ -39,8 +39,6 @@ namespace llvm {
|
|||
void anchor() override;
|
||||
public:
|
||||
explicit X86ELFMCAsmInfo(const Triple &Triple);
|
||||
const MCSection *
|
||||
getNonexecutableStackSection(MCContext &Ctx) const override;
|
||||
};
|
||||
|
||||
class X86MCAsmInfoMicrosoft : public MCAsmInfoMicrosoft {
|
||||
|
|
Loading…
Reference in New Issue