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

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 11:33:06 PDT 2023


================
@@ -215,7 +205,38 @@ Error SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol,
 
   if (Obj.isELF() && ELFSymbolRef(Symbol).getBinding() != ELF::STB_LOCAL)
     ELFSymIdx = 0;
-  Symbols.push_back({SymbolAddress, SymbolSize, SymbolName, ELFSymIdx});
+
+  // If the SymbolAddress exists, use the one with the large Size.
+  // This helps us avoid symbols with no size information (Size = 0).
+  if (!Symbols.count(SymbolAddress) ||
+      (!Obj.isXCOFF() && SymbolSize >= Symbols[SymbolAddress].Size)) {
----------------
diggerlin wrote:

if not effect test case , suggest change 
` SymbolSize >= Symbols[SymbolAddress].Size)` to
`SymbolSize > Symbols[SymbolAddress].Size)`

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


More information about the llvm-commits mailing list