OSDN Git Service

Move getNonexecutableStackSection up to the base ELF class.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 15 Oct 2014 15:44:16 +0000 (15:44 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 15 Oct 2014 15:44:16 +0000 (15:44 +0000)
The .note.GNU-stack section is not SystemZ/X86 specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219796 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfoELF.h
lib/MC/MCAsmInfoELF.cpp
lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp
lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.h
lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.h

index 27fea84..7bd2460 100644 (file)
@@ -15,6 +15,9 @@
 namespace llvm {
 class MCAsmInfoELF : public MCAsmInfo {
   virtual void anchor();
+  const MCSection *
+  getNonexecutableStackSection(MCContext &Ctx) const override final;
+
 protected:
   MCAsmInfoELF();
 };
index ccb3dc3..9f70d8d 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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";
index d8939fd..f332e4d 100644 (file)
@@ -44,8 +44,3 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(StringRef &TT) : MCAsmInfoELF() {
   //===--- Dwarf Emission Directives -----------------------------------===//
   SupportsDebugInformation = true;
 }
-
-const MCSection*
-AMDGPUMCAsmInfo::getNonexecutableStackSection(MCContext &CTX) const {
-  return nullptr;
-}
index 637a977..8f75c76 100644 (file)
@@ -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
index aed407e..35887fa 100644 (file)
@@ -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());
-}
index f582bd3..19b5b4b 100644 (file)
@@ -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
index 63aa086..3a67f6a 100644 (file)
@@ -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) {
index 26fb8a7..f2f06c3 100644 (file)
@@ -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 {