[llvm] [llvm-symbolizer] Make symbolizer parse section relative syntax (PR #168524)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 4 02:05:08 PDT 2026
================
@@ -0,0 +1,95 @@
+## Test section-relative address syntax for XCOFF.
+## The syntax (SECTION_TYPE)(+offset) represents the offset from section base.
+## Only TEXT and DATA section types are supported.
+
+## Create XCOFF object with TEXT section at address 0x100 and DATA at 0x200.
+# RUN: yaml2obj %s --docnum=1 -o %t.xcoff
+
+## Test 1: Symbolize function using TEXT section-relative offset.
+## .foo is at 0x100 (TEXT base) + 0x0 offset.
+# RUN: llvm-symbolizer --obj=%t.xcoff '(TEXT)(+0x0)' | FileCheck %s --check-prefix=TEXT-FOO
+
+# TEXT-FOO: .foo
+# TEXT-FOO-NEXT: ??:0:0
+
+## Test 2: Symbolize function at offset within TEXT section.
+## .bar is at 0x100 (TEXT base) + 0x4 offset = 0x104.
+# RUN: llvm-symbolizer --obj=%t.xcoff '(TEXT)(+0x4)' | FileCheck %s --check-prefix=TEXT-BAR
+
+# TEXT-BAR: .bar
+# TEXT-BAR-NEXT: ??:0:0
+
+## Test 3: Symbolize third symbol using TEXT section-relative offset.
+## my_const is at 0x100 (TEXT base) + 0x8 offset = 0x108.
+## TODO: XMC_RO should be classified as ST_Data; expect my_const once fixed.
+## ISSUE: https://github.com/llvm/llvm-project/issues/194547.
----------------
midhuncodes7 wrote:
Moved as suggested
https://github.com/llvm/llvm-project/pull/168524
More information about the llvm-commits
mailing list