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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 01:07:58 PDT 2026


================
@@ -1013,6 +1014,42 @@ static char getSymbolNMTypeChar(COFFImportFile &Obj) {
   return '?';
 }
 
+static char getSymbolNMTypeChar(GOFFObjectFile &Obj, basic_symbol_iterator I) {
+  symbol_iterator SymI(I);
+  Expected<section_iterator> SecIOrErr = SymI->getSection();
+  if (!SecIOrErr) {
+    consumeError(SecIOrErr.takeError());
+    return '?';
+  }
+
+  GOFFSymbolRef Ref(*I);
+  Expected<uint32_t> Flags = Ref.getSymbolGOFFFlags();
+  Expected<SymbolRef::Type> Type = Ref.getSymbolGOFFType();
+
+  if (!Type || !Flags) {
+    return '?';
----------------
jh7370 wrote:

> With respect to yaml2obj, I believe the support for GOFF records is still in progress

Assuming this is correct, let's add a TODO note here and then a comment in the corresponding yaml2obj PR (if it exists) to note that the test case should be added once the yaml2obj support is ready (in a separate PR, once yaml2obj support is done, probably).

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


More information about the llvm-commits mailing list