[llvm] [DWARF5][COFF] Fix wrong relocation in .debug_line (PR #83773)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 08:23:19 PDT 2024


================
@@ -0,0 +1,13 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-windows-gnu %s -o - | llvm-readobj -r  - | FileCheck %s
+
+// CHECK: Relocations [
+// CHECK:  Section (4) .debug_line {
+// CHECK:    0x22 IMAGE_REL_AMD64_SECREL .debug_line_str (8)
+// CHECK:    0x2C IMAGE_REL_AMD64_SECREL .debug_line_str (8)
+// CHECK:    0x36 IMAGE_REL_AMD64_ADDR64 .text (0)
+// CHECK:  }
+
+main:                                
+	.file	0 "/" "test.c"
+	.loc	0 1 0
----------------
timoh-ba wrote:

Well, you're asking a really good question there. I tested around a bit and you seem to be correct about the difference between dwarf4 & dwarf5 here. I tried to find some llvm documentation about this but couldn't find anything, I'll probably need to look through the assembly parser to find out what each of those fields mean? I got the assembly out of clang, haven't written it myself.

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


More information about the llvm-commits mailing list