diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-01-15 23:59:13 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-01-15 23:59:13 +0000 |
commit | 2f301f3e928089694f0e9deb3617cb81ba672320 (patch) | |
tree | 7635614f9a3af4fdb524ef618f304ed782aaf879 /llvm/lib/MC/MCAsmInfoELF.cpp | |
parent | 5be0706ebe1616687ce9bf0e9d558a0bf97b85dc (diff) | |
download | bcm5719-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.cpp | 3 |
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; } |