[llvm] [SystemZ][z/OS] yaml2obj GOFF symbols (PR #75971)

Yusra Syeda via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 12:59:21 PDT 2024


================
@@ -245,6 +248,57 @@ void GOFFState::writeHeader(GOFFYAML::FileHeader &FileHdr) {
   }
 }
 
+void GOFFState::writeSymbol(GOFFYAML::Symbol Sym) {
+  if (Sym.ID != SymbolID + 1)
+    reportError("symbol IDs not monotonic " + Sym.Name);
+  else
+    ++SymbolID;
+  if (Sym.OwnerID >= SymbolID)
+    reportError("owner ID not defined " + Sym.Name);
+  SmallString<80> SymName;
+  if (std::error_code EC = ConverterEBCDIC::convertToEBCDIC(Sym.Name, SymName))
+    reportError("conversion error on " + Sym.Name);
+  size_t SymLength = SymName.size();
+  if (SymLength > GOFF::MaxDataLength)
----------------
ysyeda wrote:

Yes, MaxDataLength is the maximum number of bytes that can be included in the file format.

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


More information about the llvm-commits mailing list