aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86TargetObjectFile.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-03-15 19:04:37 +0000
committerBill Wendling <isanbard@gmail.com>2010-03-15 19:04:37 +0000
commit9a80c2e360df59546b36f76d559dbbbb1d0ec06d (patch)
tree28c6b4658e802108b5f681886cd9ee29501e3a80 /lib/Target/X86/X86TargetObjectFile.cpp
parentec29058eb023ef791b0bd97ac270aab9c7278b74 (diff)
downloadexternal_llvm-9a80c2e360df59546b36f76d559dbbbb1d0ec06d.zip
external_llvm-9a80c2e360df59546b36f76d559dbbbb1d0ec06d.tar.gz
external_llvm-9a80c2e360df59546b36f76d559dbbbb1d0ec06d.tar.bz2
Place the LSDA into the TEXT section for x86 Darwin. If the global it's pointing
to is local to the translation unit, we need to place fill the value of that symbol into the non-lazy pointer. This should conclude all Darwin changes for placing the LSDA into the TEXT section. There is some cleanup to do. I.e., there's no longer a special need for target-specific code here. But that can come later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetObjectFile.cpp')
-rw-r--r--lib/Target/X86/X86TargetObjectFile.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/X86/X86TargetObjectFile.cpp b/lib/Target/X86/X86TargetObjectFile.cpp
index f49153b..755967b 100644
--- a/lib/Target/X86/X86TargetObjectFile.cpp
+++ b/lib/Target/X86/X86TargetObjectFile.cpp
@@ -12,12 +12,26 @@
#include "X86TargetMachine.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCSectionMachO.h"
#include "llvm/Target/Mangler.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Dwarf.h"
using namespace llvm;
using namespace dwarf;
+void X86_MachoTargetObjectFile::Initialize(MCContext &Ctx,
+ const TargetMachine &TM) {
+ TargetLoweringObjectFileMachO::Initialize(Ctx, TM);
+
+ // Exception Handling.
+ LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0,
+ SectionKind::getReadOnlyWithRel());
+}
+
+unsigned X86_MachoTargetObjectFile::getTTypeEncoding() const {
+ return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
+}
+
const MCExpr *X8664_MachoTargetObjectFile::
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
MachineModuleInfo *MMI, unsigned Encoding,