diff options
Diffstat (limited to 'llvm/lib/MC/MCAsmInfoELF.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmInfoELF.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCAsmInfoELF.cpp b/llvm/lib/MC/MCAsmInfoELF.cpp index cdae9d7..98090d3 100644 --- a/llvm/lib/MC/MCAsmInfoELF.cpp +++ b/llvm/lib/MC/MCAsmInfoELF.cpp @@ -27,12 +27,13 @@ using namespace llvm; void MCAsmInfoELF::anchor() {} -MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const { +MCSection *MCAsmInfoELF::getStackSection(MCContext &Ctx, bool Exec) const { // Solaris doesn't know/doesn't care about .note.GNU-stack sections, so // don't emit them. if (Ctx.getTargetTriple().isOSSolaris()) return nullptr; - return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0); + return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, + Exec ? ELF::SHF_EXECINSTR : 0U); } bool MCAsmInfoELF::useCodeAlign(const MCSection &Sec) const { |