summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmInfoELF.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-01-15 23:59:13 +0000
committerDan Gohman <dan433584@gmail.com>2016-01-15 23:59:13 +0000
commit2f301f3e928089694f0e9deb3617cb81ba672320 (patch)
tree7635614f9a3af4fdb524ef618f304ed782aaf879 /llvm/lib/MC/MCAsmInfoELF.cpp
parent5be0706ebe1616687ce9bf0e9d558a0bf97b85dc (diff)
downloadbcm5719-llvm-2f301f3e928089694f0e9deb3617cb81ba672320.tar.gz
bcm5719-llvm-2f301f3e928089694f0e9deb3617cb81ba672320.zip
[WebAssembly] Don't create a needless .note.GNU-stack section
WebAssembly's stack will never be executable by default, so it isn't necessary to declare .note.GNU-stack sections to request a non-executable stack. Differential Revision: http://reviews.llvm.org/D15969 llvm-svn: 257962
Diffstat (limited to 'llvm/lib/MC/MCAsmInfoELF.cpp')
-rw-r--r--llvm/lib/MC/MCAsmInfoELF.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAsmInfoELF.cpp b/llvm/lib/MC/MCAsmInfoELF.cpp
index 2bff6e05966..26e5608d873 100644
--- a/llvm/lib/MC/MCAsmInfoELF.cpp
+++ b/llvm/lib/MC/MCAsmInfoELF.cpp
@@ -21,6 +21,8 @@ using namespace llvm;
void MCAsmInfoELF::anchor() { }
MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
+ if (!UsesNonexecutableStackSection)
+ return nullptr;
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0);
}
@@ -29,4 +31,5 @@ MCAsmInfoELF::MCAsmInfoELF() {
WeakRefDirective = "\t.weak\t";
PrivateGlobalPrefix = ".L";
PrivateLabelPrefix = ".L";
+ UsesNonexecutableStackSection = true;
}
OpenPOWER on IntegriCloud