Linux wants the FDE initial location and address range to be forced to 32-bit.
authorBill Wendling <isanbard@gmail.com>
Mon, 29 Dec 2008 22:12:11 +0000 (22:12 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 29 Dec 2008 22:12:11 +0000 (22:12 +0000)
Darwin doesn't. Make this optional for platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61484 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/CodeGen/AsmPrinter/DwarfWriter.cpp
lib/Target/TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index aa9c14514c92fa8cc1bd6b728d188b22f0088bfe..c880179038d732bf6f5e32be86edf3ca96dfa75a 100644 (file)
@@ -457,6 +457,11 @@ namespace llvm {
     /// 
     bool NonLocalEHFrameLabel;              // Defaults to false.
 
+    /// Force32BitFDEReference - Force the FDE initial location and address
+    /// range to be 32-bit sized.
+    ///
+    bool Force32BitFDEReference;            // Defaults to true.
+
     /// GlobalEHDirective - This is the directive used to make exception frame
     /// tables globally visible.
     ///
@@ -829,6 +834,9 @@ namespace llvm {
     bool doesRequireNonLocalEHFrameLabel() const {
       return NonLocalEHFrameLabel;
     }
+    bool doesRequire32BitFDEReference() const {
+      return Force32BitFDEReference;
+    }
     const char *getGlobalEHDirective() const {
       return GlobalEHDirective;
     }
index 6534f401cc6aa970d29e7d6ee3f3e10c8aaa29dc..691c922d0af3f03b42b70107577308cb1a430f90 100644 (file)
@@ -3119,10 +3119,12 @@ private:
 
       Asm->EOL("FDE CIE offset");
 
-      EmitReference("eh_func_begin", EHFrameInfo.Number, true);
+      EmitReference("eh_func_begin", EHFrameInfo.Number, true, 
+                    TAI->doesRequire32BitFDEReference());
       Asm->EOL("FDE initial location");
       EmitDifference("eh_func_end", EHFrameInfo.Number,
-                     "eh_func_begin", EHFrameInfo.Number);
+                     "eh_func_begin", EHFrameInfo.Number,
+                     TAI->doesRequire32BitFDEReference());
       Asm->EOL("FDE address range");
 
       // If there is a personality and landing pads then point to the language
index c9a525a506edecc76bc010fe110e7238213c85ea..5cf298aa95ba58a481aefbe0831d0c965d5f8f22 100644 (file)
@@ -101,6 +101,7 @@ void TargetAsmInfo::fillDefaultValues() {
   DwarfRequiresFrameSection = true;
   FDEEncodingRequiresSData4 = true;
   NonLocalEHFrameLabel = false;
+  Force32BitFDEReference = true;
   GlobalEHDirective = 0;
   SupportsWeakOmittedEHFrame = true;
   DwarfSectionOffsetDirective = 0;
index 4dfb214ec71fc7ffcf8bf6e5959c74d3e70a20f3..de655e732b23f6bbab53a3c03ee4c4fed4393c3e 100644 (file)
@@ -72,6 +72,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
   HasSingleParameterDotFile = false;
   FDEEncodingRequiresSData4 = false;
   NonLocalEHFrameLabel = true;
+  Force32BitFDEReference = false;
   if (TM.getRelocationModel() == Reloc::Static) {
     StaticCtorsSection = ".constructor";
     StaticDtorsSection = ".destructor";