summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-12-24 08:05:17 +0000
committerBill Wendling <isanbard@gmail.com>2008-12-24 08:05:17 +0000
commitd6bd7e93727115e55929e7eb3ed7e5e984956881 (patch)
tree042830e4748305d636c8fc031fc463f2aaa6558c /llvm/lib
parent2907ab7d779cd7eb5f7704f9b62419251d7a4b37 (diff)
downloadbcm5719-llvm-d6bd7e93727115e55929e7eb3ed7e5e984956881.tar.gz
bcm5719-llvm-d6bd7e93727115e55929e7eb3ed7e5e984956881.zip
Darwin likes for the EH frame to be non-local.
llvm-svn: 61420
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp20
-rw-r--r--llvm/lib/Target/TargetAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/X86/X86TargetAsmInfo.cpp1
3 files changed, 18 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 42ed34879e3..70d4d1ffecc 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -2963,7 +2963,10 @@ private:
// Begin eh frame section.
Asm->SwitchToTextSection(TAI->getDwarfEHFrameSection());
- O << TAI->getEHGlobalPrefix() << "EH_frame" << Index << ":\n";
+
+ if (!TAI->doesRequireNonLocalEHFrameLabel())
+ O << TAI->getEHGlobalPrefix();
+ O << "EH_frame" << Index << ":\n";
EmitLabel("section_eh_frame", Index);
// Define base labels.
@@ -3102,9 +3105,18 @@ private:
EmitLabel("eh_frame_begin", EHFrameInfo.Number);
- EmitSectionOffset("eh_frame_begin", "eh_frame_common",
- EHFrameInfo.Number, EHFrameInfo.PersonalityIndex,
- true, true, false);
+ if (TAI->doesRequireNonLocalEHFrameLabel()) {
+ PrintRelDirective(true, true);
+ PrintLabelName("eh_frame_begin", EHFrameInfo.Number);
+
+ if (!TAI->isAbsoluteEHSectionOffsets())
+ O << "-EH_frame" << EHFrameInfo.PersonalityIndex;
+ } else {
+ EmitSectionOffset("eh_frame_begin", "eh_frame_common",
+ EHFrameInfo.Number, EHFrameInfo.PersonalityIndex,
+ true, true, false);
+ }
+
Asm->EOL("FDE CIE offset");
EmitReference("eh_func_begin", EHFrameInfo.Number, true, true);
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp
index b6adbe7ac12..c9a525a506e 100644
--- a/llvm/lib/Target/TargetAsmInfo.cpp
+++ b/llvm/lib/Target/TargetAsmInfo.cpp
@@ -100,6 +100,7 @@ void TargetAsmInfo::fillDefaultValues() {
SupportsExceptionHandling = false;
DwarfRequiresFrameSection = true;
FDEEncodingRequiresSData4 = true;
+ NonLocalEHFrameLabel = false;
GlobalEHDirective = 0;
SupportsWeakOmittedEHFrame = true;
DwarfSectionOffsetDirective = 0;
diff --git a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
index 0dfb8550f6d..4dfb214ec71 100644
--- a/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -71,6 +71,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
HasDotTypeDotSizeDirective = false;
HasSingleParameterDotFile = false;
FDEEncodingRequiresSData4 = false;
+ NonLocalEHFrameLabel = true;
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".constructor";
StaticDtorsSection = ".destructor";
OpenPOWER on IntegriCloud