[PATCH] D113552: [yaml2obj][XCOFF] parsing auxiliary symbols.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 03:40:55 PST 2021


jhenderson added a comment.

Apologies, no idea how this one slipped off the radar. Mostly looks good, but some test comments.



================
Comment at: llvm/lib/ObjectYAML/XCOFFEmitter.cpp:516
+  else
+    ErrHandler("unknown auxiliary symbol type: " + Twine(AuxSym->Type));
+}
----------------
I don't think you've got a test case for this case?


================
Comment at: llvm/lib/ObjectYAML/XCOFFEmitter.cpp:577-578
+      // Pad with zeros.
+      if (NumOfAuxSym > YamlSym.AuxEntries.size())
+        W.OS.write_zeros(XCOFF::SymbolTableEntrySize *
+                         (NumOfAuxSym - YamlSym.AuxEntries.size()));
----------------
Is there testing for this case?


================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:2
+## Check that we are able to dump auxiliary symbols.
+## 1. We can set default values for the fields of auxiliary symbols.
+## 2. We can explicitly specify all fields for auxiliary symbols.
----------------



================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:456
+
+## Case5: the file name greater than 8 bytes in the AUX_FILE symbol
+##        is stored in the string table.
----------------



================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:496-501
+## Case6: show that yaml2obj reports an error when trying to write
+##        the AUX_STAT symbol for XCOFF32.
+# RUN: not yaml2obj %s --docnum=4 -o %t6 2>&1 | FileCheck %s \
+# RUN:   --check-prefix=STAT64
+
+# STAT64: error: the section auxiliary entry for the C_STAT Symbol is defined in XCOFF32 only
----------------
This comment and error don't match up. According to the comment, I'd expect to see a complaint about using AUX_STAT in XCOFF32, but the error is soemthing about C_STAT symbols being defined in XCOFF32.


================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:512-517
+## Case7: show that yaml2obj reports an error when trying to write
+##        the AUX_EXCEPT symbol for XCOFF64.
+# RUN: not yaml2obj %s --docnum=5 -o %t7 2>&1 | FileCheck %s \
+# RUN:   --check-prefix=EXCEPT32
+
+# EXCEPT32: error: the exception auxiliary symbol table entry is defined in XCOFF64 only
----------------
Same sort of comment as above.


================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:527
+      - Type: AUX_EXCEPT
+
+
----------------
Nit: double blank line


================
Comment at: llvm/test/tools/yaml2obj/XCOFF/aux-symbols.yaml:529-530
+
+## Case8: the specified value of NumberOfAuxEntries should greater
+##        than the actual number of aux entries.
+# RUN: not yaml2obj %s --docnum=6 -o %t8 2>&1 | FileCheck %s \
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113552/new/

https://reviews.llvm.org/D113552



More information about the llvm-commits mailing list