[Lldb-commits] [lldb] [lldb] Fix block address resolution for functions in multiple sections (PR #137955)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri May 2 07:59:33 PDT 2025


================
@@ -0,0 +1,102 @@
+# REQUIRES: x86, lld
+
+# RUN: split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %t/file.s -o %t/file.o
+# RUN: ld.lld %t/file.o -o %t/file.out -T %t/file.lds
+# RUN: %lldb %t/file.out -o "disassemble --name func1" -o exit | FileCheck %s
+
+# CHECK:      (lldb) disassemble --name func1
+# CHECK:      file.out`func1:
+# CHECK-NEXT: file.out[0x0] <+0>: int    $0x2a
+# CHECK:      file.out`func1:
+# CHECK-NEXT: file.out[0x1000] <+4096>: int    $0x2f
+
+
+#--- file.lds
+PHDRS {
----------------
labath wrote:

Added something, though I don't know if it helps. There aren't any "tricky" situations here, basically, the only requirement is to have a function in multiple sections. Its just that creating a binary with deterministic content takes up a bunch of space (for the DWARF mainly). It would be possible to create this setup with a compiler, but then both the instructions and their addresses would be unpredictable so it would be hard to assert anything.

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


More information about the lldb-commits mailing list