[llvm-commits] [llvm] r61420 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp
Bill Wendling
isanbard at gmail.com
Wed Dec 24 00:05:20 PST 2008
Author: void
Date: Wed Dec 24 02:05:17 2008
New Revision: 61420
URL: http://llvm.org/viewvc/llvm-project?rev=61420&view=rev
Log:
Darwin likes for the EH frame to be non-local.
Modified:
llvm/trunk/include/llvm/Target/TargetAsmInfo.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
llvm/trunk/lib/Target/TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=61420&r1=61419&r2=61420&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Wed Dec 24 02:05:17 2008
@@ -453,6 +453,10 @@
///
bool FDEEncodingRequiresSData4; // Defaults to true
+ /// NonLocalEHFrameLabel - If set, the EH_frame label needs to be non-local.
+ ///
+ bool NonLocalEHFrameLabel; // Defaults to false.
+
/// GlobalEHDirective - This is the directive used to make exception frame
/// tables globally visible.
///
@@ -822,6 +826,9 @@
bool doesFDEEncodingRequireSData4() const {
return FDEEncodingRequiresSData4;
}
+ bool doesRequireNonLocalEHFrameLabel() const {
+ return NonLocalEHFrameLabel;
+ }
const char *getGlobalEHDirective() const {
return GlobalEHDirective;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=61420&r1=61419&r2=61420&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Dec 24 02:05:17 2008
@@ -2963,7 +2963,10 @@
// 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 @@
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);
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=61420&r1=61419&r2=61420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Wed Dec 24 02:05:17 2008
@@ -100,6 +100,7 @@
SupportsExceptionHandling = false;
DwarfRequiresFrameSection = true;
FDEEncodingRequiresSData4 = true;
+ NonLocalEHFrameLabel = false;
GlobalEHDirective = 0;
SupportsWeakOmittedEHFrame = true;
DwarfSectionOffsetDirective = 0;
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=61420&r1=61419&r2=61420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Wed Dec 24 02:05:17 2008
@@ -71,6 +71,7 @@
HasDotTypeDotSizeDirective = false;
HasSingleParameterDotFile = false;
FDEEncodingRequiresSData4 = false;
+ NonLocalEHFrameLabel = true;
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".constructor";
StaticDtorsSection = ".destructor";
More information about the llvm-commits
mailing list