[PATCH] D70661: [MC] Produce proper section relative relocations for COFF in .debug_frame

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 00:51:31 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG47046f05e66c: [MC] Produce proper section relative relocations for COFF in .debug_frame (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70661/new/

https://reviews.llvm.org/D70661

Files:
  llvm/lib/MC/MCDwarf.cpp
  llvm/test/MC/COFF/cfi-sections.s


Index: llvm/test/MC/COFF/cfi-sections.s
===================================================================
--- /dev/null
+++ llvm/test/MC/COFF/cfi-sections.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-mingw32 %s -o - | llvm-objdump -r - | FileCheck --check-prefix=COFF_X86_64 %s
+// RUN: llvm-mc -filetype=obj -triple i686-mingw32 %s -o - | llvm-objdump -r - | FileCheck --check-prefix=COFF_I686 %s
+
+.cfi_sections .debug_frame
+
+f1:
+        .cfi_startproc
+        nop
+        .cfi_endproc
+
+f2:
+        .cfi_startproc
+        nop
+        .cfi_endproc
+
+// COFF_X86_64: RELOCATION RECORDS FOR [.debug_frame]:
+// COFF_X86_64-NEXT: {{.*}} IMAGE_REL_AMD64_SECREL .debug_frame
+// COFF_X86_64-NEXT: {{.*}} IMAGE_REL_AMD64_ADDR64 .text
+// COFF_X86_64-NEXT: {{.*}} IMAGE_REL_AMD64_SECREL .debug_frame
+// COFF_X86_64-NEXT: {{.*}} IMAGE_REL_AMD64_ADDR64 .text
+
+// COFF_I686: RELOCATION RECORDS FOR [.debug_frame]:
+// COFF_I686-NEXT: {{.*}} IMAGE_REL_I386_SECREL .debug_frame
+// COFF_I686-NEXT: {{.*}} IMAGE_REL_I386_DIR32 .text
+// COFF_I686-NEXT: {{.*}} IMAGE_REL_I386_SECREL .debug_frame
+// COFF_I686-NEXT: {{.*}} IMAGE_REL_I386_DIR32 .text
Index: llvm/lib/MC/MCDwarf.cpp
===================================================================
--- llvm/lib/MC/MCDwarf.cpp
+++ llvm/lib/MC/MCDwarf.cpp
@@ -1701,7 +1701,8 @@
         MakeStartMinusEndExpr(Streamer, SectionStart, cieStart, 0);
     emitAbsValue(Streamer, offset, 4);
   } else {
-    Streamer.EmitSymbolValue(&cieStart, 4);
+    Streamer.EmitSymbolValue(&cieStart, 4,
+                             asmInfo->needsDwarfSectionOffsetDirective());
   }
 
   // PC Begin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70661.231192.patch
Type: text/x-patch
Size: 1659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191127/ebd99d2a/attachment.bin>


More information about the llvm-commits mailing list