[llvm] [llvm/mc] Add support for sdata8 for FDE CIE (PR #174508)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 21:58:08 PST 2026


================
@@ -354,10 +354,15 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
   case Triple::ppc64le:
   case Triple::aarch64:
   case Triple::aarch64_be:
-  case Triple::x86_64:
-    FDECFIEncoding = dwarf::DW_EH_PE_pcrel |
-                     (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4);
+  case Triple::x86_64: {
+    // Check if the user requested large FDE encoding via MCTargetOptions
+    const MCTargetOptions *TO = Ctx->getTargetOptions();
+    bool Use8ByteFDE = Large || (TO && TO->LargeFDEEncoding);
----------------
MaskRay wrote:

I have created https://github.com/llvm/llvm-project/pull/180464 to avoid nullable MCTargetOptions, which is an anti-pattern in many MC files. I hope 180464 lands first.


https://github.com/llvm/llvm-project/pull/174508


More information about the llvm-commits mailing list