[llvm] [llvm-nm][GOFF] Support symbol types and sizes (PR #207119)

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 22:21:03 PDT 2026


================
@@ -26,9 +26,9 @@ entry:
   ret void
 }
 
-; CHECK-DAG: {{^[0-9A-Fa-f]+}} {{0*4}} D GlobalData
-; CHECK-DAG: {{^[0-9A-Fa-f]+}} {{0*4}} d LocalData
-; CHECK-DAG: {{^[0-9A-Fa-f]+}} {{[0-9A-Fa-f]+}} T GlobalFunc
-; CHECK-DAG: {{^[0-9A-Fa-f]+}} {{[0-9A-Fa-f]+}} t LocalFunc
-; CHECK-DAG: {{^[0-9A-Fa-f]+}} {{[0-9A-Fa-f]+}} T UseExternFunc
-; CHECK-DAG: {{^ *}}U ExternFunc
+; CHECK-DAG: {{^[0-9A-Fa-f]+}} 0000000000000004 D GlobalData
+; CHECK-DAG: {{^[0-9A-Fa-f]+}} 0000000000000004 d LocalData
+; CHECK-DAG: {{^[0-9A-Fa-f]+}} 0000000000000000 T GlobalFunc
----------------
amy-kwan wrote:

Thanks for the feedback. The `GlobalData` and `LocalData` symbols in this test are PR (Part Reference) records with a size of 4, so I think they already serve as the non-zero-size verification with the `0000000000000004` in the CHECKs confirming that the size field is being read correctly.

As @daltenty noted, the functions in this test are LD (Label Definition) records in GOFF and don't carry a size field at all, so as far as I can tell, the zeroes are expected for these (also, I've tried generating the test with `--function-sections`, and this does not appear to have any difference in the size for label definitions).

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


More information about the llvm-commits mailing list