diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-12-24 08:05:17 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-12-24 08:05:17 +0000 |
commit | 722f5f1cfb9a5e59a4c00986d81b04b0c015703d (patch) | |
tree | 498a47db9b3bb7557d939057d5e7876a3cf0c93e /lib | |
parent | d4121bef3cf3af51b80c2d499085a96aca5982ed (diff) | |
download | llvm-722f5f1cfb9a5e59a4c00986d81b04b0c015703d.tar.gz llvm-722f5f1cfb9a5e59a4c00986d81b04b0c015703d.tar.bz2 llvm-722f5f1cfb9a5e59a4c00986d81b04b0c015703d.tar.xz |
Darwin likes for the EH frame to be non-local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 20 | ||||
-rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 1 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 1 |
3 files changed, 18 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 42ed34879e..70d4d1ffec 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/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/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index b6adbe7ac1..c9a525a506 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/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/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index 0dfb8550f6..4dfb214ec7 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/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"; |