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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 01:00:30 PDT 2026


================
@@ -1013,6 +1014,23 @@ static char getSymbolNMTypeChar(COFFImportFile &Obj) {
   return '?';
 }
 
+static char getSymbolNMTypeChar(GOFFObjectFile &, basic_symbol_iterator I) {
+  GOFFSymbolRef Ref(*I);
+  Expected<SymbolRef::Type> Type = Ref.getSymbolGOFFType();
+  if (!Type) {
+    consumeError(Type.takeError());
+    return '?';
+  }
+  switch (*Type) {
+  case SymbolRef::ST_Data:
+    return 'd';
+  case SymbolRef::ST_Function:
+    return 't';
+  default:
+    return '?';
----------------
jh7370 wrote:

Same question as above, but I guess it would need to be a code path that could produce an unknown `SymbolRef::ST*` value. If such a code path doesn't exist, it should be `llvm_unreachable` instead.

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


More information about the llvm-commits mailing list