aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2011-05-20 22:13:55 +0000
committerCharles Davis <cdavis@mines.edu>2011-05-20 22:13:55 +0000
commitf3ffc2cd76267b7901088ec5e46e875a2701bda9 (patch)
tree5419e15c981ab1c92ddac1fd805ef238427059e9
parent958b68140e08df76e1b8f3287cd0a24d0fb35734 (diff)
downloadexternal_llvm-f3ffc2cd76267b7901088ec5e46e875a2701bda9.zip
external_llvm-f3ffc2cd76267b7901088ec5e46e875a2701bda9.tar.gz
external_llvm-f3ffc2cd76267b7901088ec5e46e875a2701bda9.tar.bz2
Add .pdata and .xdata sections to the COFF TLOF implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131763 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/TargetLoweringObjectFileImpl.h10
-rw-r--r--include/llvm/Target/TargetLoweringObjectFile.h2
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp15
3 files changed, 27 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index 829f580..c61cf39 100644
--- a/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -58,6 +58,8 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection() const { return NULL; }
+ virtual const MCSection *getWin64EHTableSection() const { return NULL; }
virtual void emitPersonalityValue(MCStreamer &Streamer,
const TargetMachine &TM,
@@ -133,6 +135,8 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection() const { return NULL; }
+ virtual const MCSection *getWin64EHTableSection() const { return NULL; }
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
@@ -196,6 +200,8 @@ public:
class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
const MCSection *DrectveSection;
+ const MCSection *PDataSection;
+ const MCSection *XDataSection;
public:
TargetLoweringObjectFileCOFF() {}
~TargetLoweringObjectFileCOFF() {}
@@ -203,6 +209,10 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection() const {
+ return PDataSection;
+ }
+ virtual const MCSection *getWin64EHTableSection() const {return XDataSection;}
virtual const MCSection *getDrectveSection() const { return DrectveSection; }
diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h
index ec814ff..78d49a9 100644
--- a/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/include/llvm/Target/TargetLoweringObjectFile.h
@@ -155,6 +155,8 @@ public:
const MCSection *getTLSExtraDataSection() const {
return TLSExtraDataSection;
}
+ virtual const MCSection *getWin64EHFuncTableSection() const = 0;
+ virtual const MCSection *getWin64EHTableSection() const = 0;
/// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
/// decide not to emit the UsedDirective for some symbols in llvm.used.
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index c1e1b76..964919e 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -941,6 +941,7 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx,
SectionKind::getMetadata());
DwarfLineSection =
getContext().getCOFFSection(".debug_line",
+ SectionKind::getMetadata());
COFF::IMAGE_SCN_MEM_DISCARDABLE |
COFF::IMAGE_SCN_MEM_READ,
SectionKind::getMetadata());
@@ -989,6 +990,20 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx,
getContext().getCOFFSection(".drectve",
COFF::IMAGE_SCN_LNK_INFO,
SectionKind::getMetadata());
+
+ PDataSection =
+ getContext().getCOFFSection(".pdata",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+
+ XDataSection =
+ getContext().getCOFFSection(".xdata",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
}
const MCSection *TargetLoweringObjectFileCOFF::getEHFrameSection() const {