[llvm] [XCOFF] make related SD symbols as isFunction (PR #69553)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 08:23:00 PDT 2023


================
@@ -215,7 +217,30 @@ Error SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol,
 
   if (Obj.isELF() && ELFSymbolRef(Symbol).getBinding() != ELF::STB_LOCAL)
     ELFSymIdx = 0;
-  Symbols.push_back({SymbolAddress, SymbolSize, SymbolName, ELFSymIdx});
+
+  SymbolDesc::XCOFFSymbolType Type = SymbolDesc::None;
+  if (Obj.isXCOFF()) {
+    const XCOFFSymbolRef XCOFFSymbol =
+        cast<XCOFFObjectFile>(Obj).toSymbolRef(Symbol.getRawDataRefImpl());
+    // If this is not a Csect symbol, ignore this symbol.
+    if (!XCOFFSymbol.isCsectSymbol())
+      return Error::success();
+
+    Expected<XCOFFCsectAuxRef> ExpCsectAuxEnt =
+        XCOFFSymbol.getXCOFFCsectAuxRef();
+    // If there is no aux entry, ignore this symbol.
+    if (!ExpCsectAuxEnt) {
+      consumeError(ExpCsectAuxEnt.takeError());
----------------
diggerlin wrote:

is a symbol is CsectSymbol , it must has CsectAux entry ,if there is error, we need to return the error , not just consumeError. 

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


More information about the llvm-commits mailing list