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

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 23:29:25 PDT 2023


================
@@ -83,8 +83,24 @@ class SymbolizableObjectFile : public SymbolizableModule {
     // getNameFromSymbolTable.
     uint32_t ELFLocalSymIdx;
 
+    // None if this is not a XCOFF local symbol.
+    enum XCOFFSymbolType { None, LD, SD };
+    XCOFFSymbolType Type;
+
     bool operator<(const SymbolDesc &RHS) const {
-      return Addr != RHS.Addr ? Addr < RHS.Addr : Size < RHS.Size;
+      if (Addr != RHS.Addr)
+        return Addr < RHS.Addr;
+
+      if (Type != None) {
+        // This is a XCOFF symbol. For XCOFF, XTY_SD symbol and its first XTY_LD
+        // symbol have same addresses, the symbol size of XTY_SD symbol is the
+        // size of the section while symbol size of the XTY_LD symbol is 0, but
----------------
chenzheng1030 wrote:

Done

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


More information about the llvm-commits mailing list