[PATCH] D52876: [mips] Fix FDE/CFI encoding in case of N32 ABI

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 9 04:32:12 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344040: [mips] Fix FDE/CFI encoding in case of N32 ABI (authored by atanasyan, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52876?vs=168259&id=168778#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52876

Files:
  llvm/trunk/lib/MC/MCObjectFileInfo.cpp
  llvm/trunk/test/MC/Mips/cfi-encoding.s


Index: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp
@@ -291,11 +291,11 @@
   switch (T.getArch()) {
   case Triple::mips:
   case Triple::mipsel:
-    FDECFIEncoding = dwarf::DW_EH_PE_sdata4;
-    break;
   case Triple::mips64:
   case Triple::mips64el:
-    FDECFIEncoding = dwarf::DW_EH_PE_sdata8;
+    FDECFIEncoding = Ctx->getAsmInfo()->getCodePointerSize() == 4
+                         ? dwarf::DW_EH_PE_sdata4
+                         : dwarf::DW_EH_PE_sdata8;
     break;
   case Triple::ppc64:
   case Triple::ppc64le:
Index: llvm/trunk/test/MC/Mips/cfi-encoding.s
===================================================================
--- llvm/trunk/test/MC/Mips/cfi-encoding.s
+++ llvm/trunk/test/MC/Mips/cfi-encoding.s
@@ -0,0 +1,23 @@
+# RUN: llvm-mc -filetype=obj -triple mips--gnu -g %s \
+# RUN:   | llvm-objdump -s -section=.eh_frame - | FileCheck --check-prefix=O32 %s
+# RUN: llvm-mc -filetype=obj -triple mips64--gnuabin32 -g %s \
+# RUN:   | llvm-objdump -s -section=.eh_frame - | FileCheck --check-prefix=N32 %s
+# RUN: llvm-mc -filetype=obj -triple mips64--gnuabi64 -g %s \
+# RUN:   | llvm-objdump -s -section=.eh_frame - | FileCheck --check-prefix=N64 %s
+
+# O32: 0000 00000010 00000000 017a5200 017c1f01
+# O32: 0010 0b0c1d00 00000010 00000018 00000000
+# O32: 0020 00000004 00000000
+
+# N32: 0000 00000010 00000000 017a5200 017c1f01
+# N32: 0010 0b0c1d00 00000010 00000018 00000000
+# N32: 0020 00000004 00000000
+
+# N64: 0000 00000010 00000000 017a5200 01781f01
+# N64: 0010 0c0c1d00 00000018 00000018 00000000
+# N64: 0020 00000000 00000000 00000004 00000000
+
+foo:
+  .cfi_startproc
+  nop
+  .cfi_endproc


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52876.168778.patch
Type: text/x-patch
Size: 1787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181009/8d0ad474/attachment.bin>


More information about the llvm-commits mailing list