[llvm] r222538 - Allow FDE references outside the +/-2GB range supported by PC relative

Joerg Sonnenberger joerg at bec.de
Fri Nov 21 06:42:44 PST 2014


Author: joerg
Date: Fri Nov 21 08:42:43 2014
New Revision: 222538

URL: http://llvm.org/viewvc/llvm-project?rev=222538&view=rev
Log:
Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise. 

Patch from Akos Kiss.

Differential Revision: http://reviews.llvm.org/D6079

Modified:
    llvm/trunk/lib/MC/MCObjectFileInfo.cpp

Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=222538&r1=222537&r2=222538&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Fri Nov 21 08:42:43 2014
@@ -273,6 +273,17 @@ void MCObjectFileInfo::InitELFMCObjectFi
   case Triple::mips64el:
     FDECFIEncoding = dwarf::DW_EH_PE_sdata8;
     break;
+  case Triple::x86_64:
+    if (RelocM == Reloc::PIC_) {
+      FDECFIEncoding = dwarf::DW_EH_PE_pcrel |
+        ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
+         ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
+    } else {
+      FDECFIEncoding =
+        (CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
+        ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
+    }
+    break;
   default:
     FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
     break;





More information about the llvm-commits mailing list