summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-05 00:28:39 +0000
committerDan Gohman <gohman@apple.com>2008-05-05 00:28:39 +0000
commita779a9899a5e23bd5198973f4709d66cb4bc2e64 (patch)
treef42654f8d9d6b2d0310b31500cedd1a0f93e05bb /lib/Target/X86/X86TargetAsmInfo.cpp
parent6625eff8ec38095e9dab31294a86555a489e56a4 (diff)
downloadllvm-a779a9899a5e23bd5198973f4709d66cb4bc2e64.tar.gz
llvm-a779a9899a5e23bd5198973f4709d66cb4bc2e64.tar.bz2
llvm-a779a9899a5e23bd5198973f4709d66cb4bc2e64.tar.xz
Add AsmPrinter support for emitting a directive to declare that
the code being generated does not require an executable stack. Also, add target-specific code to make use of this on Linux on x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetAsmInfo.cpp')
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 7636d77f08..4aa9d4cfa8 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -128,6 +128,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
break;
case X86Subtarget::isELF:
+ case X86Subtarget::isELFLinux:
ReadOnlySection = "\t.section\t.rodata";
FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4";
EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8";
@@ -229,6 +230,10 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
SectionEndDirectiveSuffix = "\tends\n";
}
+ // On Linux we must declare when we can use a non-executable stack.
+ if (Subtarget->isTargetLinux())
+ NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
+
AssemblerDialect = Subtarget->getAsmFlavor();
}