[llvm] [llvm-symbolizer] Make symbolizer parse section relative syntax (PR #168524)

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 07:40:01 PST 2026


================
@@ -0,0 +1,91 @@
+## Test section-relative address syntax for XCOFF.
+## The syntax (SECTION_TYPE)(+offset) represents: offset from section base.
+## Only TEXT and DATA section types are supported.
+
+# REQUIRES: system-aix
+
+## 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
----------------
hubert-reinterpretcast wrote:

Please double-check the conventions for XCOFF symbols. We ought to check for `.foo` here. Please revise for other affected lines as well.

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


More information about the llvm-commits mailing list