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

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 20:00:11 PDT 2023


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

>From 91e4b4a677310a5b2a3c959924316eff19cbd464 Mon Sep 17 00:00:00 2001
From: Chen Zheng <czhengsz at cn.ibm.com>
Date: Wed, 18 Oct 2023 04:47:01 -0400
Subject: [PATCH 1/2] nfc, use map instead of vector

---
 .../Symbolize/SymbolizableObjectFile.h        |  8 +--
 .../Symbolize/SymbolizableObjectFile.cpp      | 49 +++++++++----------
 2 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
index 075dbe3e0e372ed..8a881acb010ac3c 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
@@ -17,6 +17,7 @@
 #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
+#include <map>
 #include <memory>
 #include <string>
 #include <utility>
@@ -73,7 +74,6 @@ class SymbolizableObjectFile : public SymbolizableModule {
   bool UntagAddresses;
 
   struct SymbolDesc {
-    uint64_t Addr;
     // If size is 0, assume that symbol occupies the whole memory range up to
     // the following symbol.
     uint64_t Size;
@@ -82,12 +82,8 @@ class SymbolizableObjectFile : public SymbolizableModule {
     // Non-zero if this is an ELF local symbol. See the comment in
     // getNameFromSymbolTable.
     uint32_t ELFLocalSymIdx;
-
-    bool operator<(const SymbolDesc &RHS) const {
-      return Addr != RHS.Addr ? Addr < RHS.Addr : Size < RHS.Size;
-    }
   };
-  std::vector<SymbolDesc> Symbols;
+  std::map<uint64_t, SymbolDesc> Symbols;
   // (index, filename) pairs of ELF STT_FILE symbols.
   std::vector<std::pair<uint32_t, StringRef>> FileSymbols;
 
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
index 6b8068a531c05fa..3b5a0ce709f5c08 100644
--- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
@@ -70,20 +70,6 @@ SymbolizableObjectFile::create(const object::ObjectFile *Obj,
         return std::move(E);
   }
 
-  std::vector<SymbolDesc> &SS = res->Symbols;
-  // Sort by (Addr,Size,Name). If several SymbolDescs share the same Addr,
-  // pick the one with the largest Size. This helps us avoid symbols with no
-  // size information (Size=0).
-  llvm::stable_sort(SS);
-  auto I = SS.begin(), E = SS.end(), J = SS.begin();
-  while (I != E) {
-    auto OI = I;
-    while (++I != E && OI->Addr == I->Addr) {
-    }
-    *J++ = I[-1];
-  }
-  SS.erase(J, SS.end());
-
   return std::move(res);
 }
 
@@ -134,7 +120,10 @@ Error SymbolizableObjectFile::addCoffExportSymbols(
     uint32_t NextOffset = I != E ? I->Offset : Export.Offset + 1;
     uint64_t SymbolStart = ImageBase + Export.Offset;
     uint64_t SymbolSize = NextOffset - Export.Offset;
-    Symbols.push_back({SymbolStart, SymbolSize, Export.Name, 0});
+    // If the SymbolStart exists, use the one with the large Size.
+    // This helps us avoid symbols with no size information (Size = 0).
+    if (!Symbols.count(SymbolStart) || SymbolSize >= Symbols[SymbolStart].Size)
+      Symbols[SymbolStart] = {SymbolSize, Export.Name, 0};
   }
   return Error::success();
 }
@@ -215,7 +204,14 @@ 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) ||
+      SymbolSize >= Symbols[SymbolAddress].Size) {
+    Symbols[SymbolAddress] = {SymbolSize, SymbolName, ELFSymIdx};
+  }
+
   return Error::success();
 }
 
@@ -234,26 +230,25 @@ uint64_t SymbolizableObjectFile::getModulePreferredBase() const {
 bool SymbolizableObjectFile::getNameFromSymbolTable(
     uint64_t Address, std::string &Name, uint64_t &Addr, uint64_t &Size,
     std::string &FileName) const {
-  SymbolDesc SD{Address, UINT64_C(-1), StringRef(), 0};
-  auto SymbolIterator = llvm::upper_bound(Symbols, SD);
+  auto SymbolIterator = Symbols.upper_bound(Address);
   if (SymbolIterator == Symbols.begin())
     return false;
   --SymbolIterator;
-  if (SymbolIterator->Size != 0 &&
-      SymbolIterator->Addr + SymbolIterator->Size <= Address)
+
+  auto &SD = SymbolIterator->second;
+  if (SD.Size != 0 && SymbolIterator->first + SD.Size <= Address)
     return false;
-  Name = SymbolIterator->Name.str();
-  Addr = SymbolIterator->Addr;
-  Size = SymbolIterator->Size;
+  Name = SD.Name.str();
+  Addr = SymbolIterator->first;
+  Size = SD.Size;
 
-  if (SymbolIterator->ELFLocalSymIdx != 0) {
+  if (SD.ELFLocalSymIdx != 0) {
     // If this is an ELF local symbol, find the STT_FILE symbol preceding
     // SymbolIterator to get the filename. The ELF spec requires the STT_FILE
     // symbol (if present) precedes the other STB_LOCAL symbols for the file.
     assert(Module->isELF());
-    auto It = llvm::upper_bound(
-        FileSymbols,
-        std::make_pair(SymbolIterator->ELFLocalSymIdx, StringRef()));
+    auto It = llvm::upper_bound(FileSymbols,
+                                std::make_pair(SD.ELFLocalSymIdx, StringRef()));
     if (It != FileSymbols.begin())
       FileName = It[-1].second.str();
   }

>From e2c187e57a1a70a697ef0e0e4362848b72012f24 Mon Sep 17 00:00:00 2001
From: Chen Zheng <czhengsz at cn.ibm.com>
Date: Wed, 18 Oct 2023 21:23:15 -0400
Subject: [PATCH 2/2] set sd function symbol true for isFunction

---
 llvm/include/llvm/Object/XCOFFObjectFile.h    |  4 +++
 .../Symbolize/SymbolizableObjectFile.cpp      | 27 ++++++++++++++++++-
 llvm/lib/Object/XCOFFObjectFile.cpp           |  6 ++---
 .../CodeGen/PowerPC/aix-alias-alignment-2.ll  |  2 +-
 .../CodeGen/PowerPC/aix-alias-alignment.ll    |  2 +-
 llvm/test/CodeGen/PowerPC/aix-text.ll         | 16 +++++------
 llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll   |  2 +-
 .../CodeGen/PowerPC/aix-xcoff-funcsect.ll     | 20 +++++++-------
 .../test/CodeGen/PowerPC/pgo-ref-directive.ll |  4 +--
 llvm/test/MC/PowerPC/aix-file-symbols-empty.s |  2 +-
 llvm/test/MC/PowerPC/aix-file-symbols.s       |  2 +-
 .../XCOFF/disassemble-symbol-priority.ll      |  5 +++-
 .../llvm-objdump/XCOFF/symbol-table.test      |  4 +--
 .../tools/llvm-symbolizer/xcoff-sd-symbol.ll  |  4 +--
 14 files changed, 65 insertions(+), 35 deletions(-)

diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h
index 63064abb4d3c322..0ec2c9ceecc46f0 100644
--- a/llvm/include/llvm/Object/XCOFFObjectFile.h
+++ b/llvm/include/llvm/Object/XCOFFObjectFile.h
@@ -780,6 +780,10 @@ class XCOFFSymbolRef : public SymbolRef {
            "Symbol table entry pointer cannot be nullptr!");
   }
 
+  XCOFFSymbolRef(const SymbolRef &B) : SymbolRef(B) {
+    assert(isa<XCOFFObjectFile>(SymbolRef::getObject()));
+  }
+
   const XCOFFSymbolEntry32 *getSymbol32() const {
     return reinterpret_cast<const XCOFFSymbolEntry32 *>(getRawDataRefImpl().p);
   }
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
index 3b5a0ce709f5c08..c932540f881b4c5 100644
--- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
@@ -18,6 +18,7 @@
 #include "llvm/Object/ELFObjectFile.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolSize.h"
+#include "llvm/Object/XCOFFObjectFile.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/TargetParser/Triple.h"
@@ -208,8 +209,32 @@ Error SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol,
   // 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) ||
-      SymbolSize >= Symbols[SymbolAddress].Size) {
+      (!Obj.isXCOFF() && SymbolSize >= Symbols[SymbolAddress].Size)) {
     Symbols[SymbolAddress] = {SymbolSize, SymbolName, ELFSymIdx};
+  } else if (Obj.isXCOFF()) {
+    // If the existing entry has no name, it must be a artificial symbol,
+    // replace it.
+    if (Symbols[SymbolAddress].Name.empty()) {
+      Symbols[SymbolAddress] = {SymbolSize, SymbolName, ELFSymIdx};
+      return Error::success();
+    }
+
+    // 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 we need the XTY_LD symbol instead of
+    // the XTY_SD symbol.
+    XCOFFSymbolRef XCOFFSymbol = XCOFFSymbolRef(Symbol);
+    if (XCOFFSymbol.isCsectSymbol()) {
+      Expected<XCOFFCsectAuxRef> ExpCsectAuxEnt =
+          XCOFFSymbolRef(Symbol).getXCOFFCsectAuxRef();
+      // If there is no aux entry for, just ignore this symbol entry.
+      if (!ExpCsectAuxEnt)
+        consumeError(ExpCsectAuxEnt.takeError());
+      else {
+        if (ExpCsectAuxEnt.get().getSymbolType() == XCOFF::XTY_LD)
+          Symbols[SymbolAddress] = {SymbolSize, SymbolName, ELFSymIdx};
+      }
+    }
   }
 
   return Error::success();
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index 4c192aa37a7ecc7..3882d5951e7e2d1 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -1242,10 +1242,8 @@ bool XCOFFSymbolRef::isFunction() const {
 
   const XCOFFCsectAuxRef CsectAuxRef = ExpCsectAuxEnt.get();
 
-  // A function definition should be a label definition.
-  // FIXME: This is not necessarily the case when -ffunction-sections is
-  // enabled.
-  if (!CsectAuxRef.isLabel())
+  // A function definition should not be a common type symbol.
+  if (CsectAuxRef.getSymbolType() == XCOFF::XTY_CM)
     return false;
 
   if (CsectAuxRef.getStorageMappingClass() != XCOFF::XMC_PR)
diff --git a/llvm/test/CodeGen/PowerPC/aix-alias-alignment-2.ll b/llvm/test/CodeGen/PowerPC/aix-alias-alignment-2.ll
index 209f0e9c38385c7..fab134d73a3eab7 100644
--- a/llvm/test/CodeGen/PowerPC/aix-alias-alignment-2.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-alias-alignment-2.ll
@@ -59,7 +59,7 @@ define void @foo3(%struct.B %a1) {
 
 ; SYM:      SYMBOL TABLE:
 ; SYM-NEXT: 00000000      df *DEBUG*	00000000 <stdin>
-; SYM-NEXT: 00000000 l       .text	0000008a 
+; SYM-NEXT: 00000000 l     F .text	0000008a 
 ; SYM-NEXT: 00000000 g     F .text (csect: ) 	00000000 .foo1
 ; SYM-NEXT: 00000030 g     F .text (csect: ) 	00000000 .foo2
 ; SYM-NEXT: 00000060 g     F .text (csect: ) 	00000000 .foo3
diff --git a/llvm/test/CodeGen/PowerPC/aix-alias-alignment.ll b/llvm/test/CodeGen/PowerPC/aix-alias-alignment.ll
index a1ad80481adf160..0f08ff4ef6aefca 100644
--- a/llvm/test/CodeGen/PowerPC/aix-alias-alignment.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-alias-alignment.ll
@@ -62,7 +62,7 @@ define void @foo(i32 %a1, i32 %a2, i32 %a3) {
 
 ; SYM:      SYMBOL TABLE:
 ; SYM-NEXT: 00000000      df *DEBUG*	00000000 <stdin>
-; SYM-NEXT: 00000000 l       .text	00000029 
+; SYM-NEXT: 00000000 l     F .text	00000029 
 ; SYM-NEXT: 00000000 g     F .text (csect: ) 	00000000 .foo
 ; SYM-NEXT: 0000002c l       .data	00000008 .data
 ; SYM-NEXT: 0000002c g     O .data (csect: .data) 	00000000 _MergedGlobals
diff --git a/llvm/test/CodeGen/PowerPC/aix-text.ll b/llvm/test/CodeGen/PowerPC/aix-text.ll
index a0d1d0e38d50225..50dc723d42cc271 100644
--- a/llvm/test/CodeGen/PowerPC/aix-text.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-text.ll
@@ -17,18 +17,18 @@ entry:
   ret i32 2
 }
 
-; CHECKFS32: 00000000 l       .text  00000000 (idx: {{[[:digit:]]*}}) [PR]
-; CHECKFS32-NEXT: 00000000 g       .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) .text[PR]
-; CHECKFS32-NEXT: {{([[:xdigit:]]{8})}} g       .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) .text2[PR]
+; CHECKFS32: 00000000 l     F .text  00000000 (idx: {{[[:digit:]]*}}) [PR]
+; CHECKFS32-NEXT: 00000000 g     F .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) .text[PR]
+; CHECKFS32-NEXT: {{([[:xdigit:]]{8})}} g     F .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) .text2[PR]
 
-; CHECKFS64: 0000000000000000 l       .text  0000000000000000 
-; CHECKFS64-NEXT: 0000000000000000 g       .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) .text[PR]
-; CHECKFS64-NEXT: {{([[:xdigit:]]{16})}} g       .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) .text2[PR]
+; CHECKFS64: 0000000000000000 l     F .text  0000000000000000 
+; CHECKFS64-NEXT: 0000000000000000 g     F .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) .text[PR]
+; CHECKFS64-NEXT: {{([[:xdigit:]]{16})}} g    F .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) .text2[PR]
 
-; CHECK32: 00000000 l       .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) [PR]
+; CHECK32: 00000000 l      F .text  {{([[:xdigit:]]{8})}} (idx: {{[[:digit:]]*}}) [PR]
 ; CHECK32-NEXT: {{([[:xdigit:]]{8})}} g     F .text (csect: (idx: {{[[:digit:]]*}}) [PR])   00000000 (idx: {{[[:digit:]]*}}) .text
 ; CHECK32-NEXT: {{([[:xdigit:]]{8})}} g     F .text (csect: (idx: {{[[:digit:]]*}}) [PR])   00000000 (idx: {{[[:digit:]]*}}) .text2
 
-; CHECK64: 0000000000000000 l       .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) [PR]
+; CHECK64: 0000000000000000 l      F .text  {{([[:xdigit:]]{16})}} (idx: {{[[:digit:]]*}}) [PR]
 ; CHECK64-NEXT: {{([[:xdigit:]]{16})}} g     F .text (csect: (idx: {{[[:digit:]]*}}) [PR])   0000000000000000 (idx: {{[[:digit:]]*}}) .text
 ; CHECK64-NEXT: {{([[:xdigit:]]{8})}} g     F .text (csect: (idx: {{[[:digit:]]*}}) [PR])   0000000000000000 (idx: {{[[:digit:]]*}}) .text2
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
index db6071653b6bcca..ea236c7c582a397 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
@@ -3,7 +3,7 @@
 
 ; CHECK:      SYMBOL TABLE:
 ; CHECK-NEXT: 0000000000000000      df *DEBUG* 0000000000000000 <stdin>
-; CHECK-NEXT: 0000000000000000 l       .text   000000000000001e 
+; CHECK-NEXT: 0000000000000000 l     F .text   000000000000001e 
 ; CHECK-NEXT: 0000000000000000 g     F .text (csect: )  0000000000000000 .cold_fun
 ; CHECK-NEXT: 0000000000000020 g     O .data   0000000000000018 cold_fun
 
diff --git a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
index 09c517c73dff296..bbfd808a140f378 100644
--- a/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-xcoff-funcsect.ll
@@ -114,12 +114,12 @@ entry:
 ; XCOFF32-NEXT: 00000000      df *DEBUG*	00000000 (idx: 0) <stdin>
 ; XCOFF32-NEXT: 00000000         *UND*	00000000 (idx: 1) .extern_foo[PR]
 ; XCOFF32-NEXT: 00000000         *UND*	00000000 (idx: 3) extern_foo[DS]
-; XCOFF32-NEXT: 00000000 l       .text	00000000 (idx: 5) [PR]
-; XCOFF32-NEXT: 00000000 g       .text	00000019 (idx: 7) .foo[PR]
+; XCOFF32-NEXT: 00000000 l     F .text	00000000 (idx: 5) [PR]
+; XCOFF32-NEXT: 00000000 g     F .text	00000019 (idx: 7) .foo[PR]
 ; XCOFF32-NEXT: 00000000 g     F .text (csect: (idx: 7) .foo[PR]) 	00000000 (idx: 9) .alias_foo
-; XCOFF32-NEXT: 00000020 g       .text	00000020 .hidden (idx: 11) .hidden_foo[PR]
-; XCOFF32-NEXT: 00000040 g       .text	00000059 (idx: 13) .bar[PR]
-; XCOFF32-NEXT: 000000c0 l       .text	0000002a (idx: 15) .static_overalign_foo[PR]
+; XCOFF32-NEXT: 00000020 g     F .text	00000020 .hidden (idx: 11) .hidden_foo[PR]
+; XCOFF32-NEXT: 00000040 g     F .text	00000059 (idx: 13) .bar[PR]
+; XCOFF32-NEXT: 000000c0 l     F .text	0000002a (idx: 15) .static_overalign_foo[PR]
 ; XCOFF32-NEXT: 000000ec g     O .data	0000000c (idx: 17) foo[DS]
 ; XCOFF32-NEXT: 000000ec g     O .data (csect: (idx: 17) foo[DS]) 	00000000 (idx: 19) alias_foo
 ; XCOFF32-NEXT: 000000f8 g     O .data	0000000c .hidden (idx: 21) hidden_foo[DS]
@@ -149,12 +149,12 @@ entry:
 ; XCOFF64-NEXT: 0000000000000000      df *DEBUG*	0000000000000000 (idx: 0) <stdin>
 ; XCOFF64-NEXT: 0000000000000000         *UND*	0000000000000000 (idx: 1) .extern_foo[PR]
 ; XCOFF64-NEXT: 0000000000000000         *UND*	0000000000000000 (idx: 3) extern_foo[DS]
-; XCOFF64-NEXT: 0000000000000000 l       .text	0000000000000000 (idx: 5) [PR]
-; XCOFF64-NEXT: 0000000000000000 g       .text	0000000000000019 (idx: 7) .foo[PR]
+; XCOFF64-NEXT: 0000000000000000 l     F .text	0000000000000000 (idx: 5) [PR]
+; XCOFF64-NEXT: 0000000000000000 g     F .text	0000000000000019 (idx: 7) .foo[PR]
 ; XCOFF64-NEXT: 0000000000000000 g     F .text (csect: (idx: 7) .foo[PR]) 	0000000000000000 (idx: 9) .alias_foo
-; XCOFF64-NEXT: 0000000000000020 g       .text	0000000000000020 .hidden (idx: 11) .hidden_foo[PR]
-; XCOFF64-NEXT: 0000000000000040 g       .text	0000000000000059 (idx: 13) .bar[PR]
-; XCOFF64-NEXT: 00000000000000c0 l       .text	000000000000002a (idx: 15) .static_overalign_foo[PR]
+; XCOFF64-NEXT: 0000000000000020 g     F .text	0000000000000020 .hidden (idx: 11) .hidden_foo[PR]
+; XCOFF64-NEXT: 0000000000000040 g     F .text	0000000000000059 (idx: 13) .bar[PR]
+; XCOFF64-NEXT: 00000000000000c0 l     F .text	000000000000002a (idx: 15) .static_overalign_foo[PR]
 ; XCOFF64-NEXT: 00000000000000f0 g     O .data	0000000000000018 (idx: 17) foo[DS]
 ; XCOFF64-NEXT: 00000000000000f0 g     O .data (csect: (idx: 17) foo[DS]) 	0000000000000000 (idx: 19) alias_foo
 ; XCOFF64-NEXT: 0000000000000108 g     O .data	0000000000000018 .hidden (idx: 21) hidden_foo[DS]
diff --git a/llvm/test/CodeGen/PowerPC/pgo-ref-directive.ll b/llvm/test/CodeGen/PowerPC/pgo-ref-directive.ll
index 480b44caaded7a5..7dd4d31fca3589f 100644
--- a/llvm/test/CodeGen/PowerPC/pgo-ref-directive.ll
+++ b/llvm/test/CodeGen/PowerPC/pgo-ref-directive.ll
@@ -122,8 +122,8 @@ entry:
 
 ; WITHVNDS-OBJ:      SYMBOL TABLE:
 ; WITHVNDS-OBJ-NEXT: 00000000      df *DEBUG*	00000000 <stdin>
-; WITHVNDS-OBJ-NEXT: 00000000 l       .text	00000008 
-; WITHVNDS-OBJ-NEXT: 00000000 g     F .text (csect: ) 	00000000 .main
+; WITHVNDS-OBJ-NEXT: 00000000 l     F .text	00000008 
+; WITHVNDS-OBJ-NEXT: 00000000 g     F .text (csect: )	00000000 .main
 ; WITHVNDS-OBJ-NEXT: 00000008 l       .text	00000006 __llvm_prf_names
 ; WITHVNDS-OBJ-NEXT: 00000010 l     O .data	00000008 __llvm_prf_cnts
 ; WITHVNDS-OBJ-NEXT: 00000018 l     O .data	00000008 __llvm_prf_data
diff --git a/llvm/test/MC/PowerPC/aix-file-symbols-empty.s b/llvm/test/MC/PowerPC/aix-file-symbols-empty.s
index e166eef7e3fd9f6..af69781d4932c95 100644
--- a/llvm/test/MC/PowerPC/aix-file-symbols-empty.s
+++ b/llvm/test/MC/PowerPC/aix-file-symbols-empty.s
@@ -9,6 +9,6 @@
 
 # CHECK:      SYMBOL TABLE:
 # CHECK-NEXT: 00000000      df *DEBUG*	00000000 .file
-# CHECK-NEXT: 00000000 l       .text	00000000 
+# CHECK-NEXT: 00000000 l     F .text	00000000 
 # CHECK-NEXT: 00000000 g     F .text (csect: ) 	00000000 .var1
 # CHECK-NEXT: 00000000 g     F .text (csect: ) 	00000000 .var2
diff --git a/llvm/test/MC/PowerPC/aix-file-symbols.s b/llvm/test/MC/PowerPC/aix-file-symbols.s
index 7ab0244f3c7141e..6f9d6341f345055 100644
--- a/llvm/test/MC/PowerPC/aix-file-symbols.s
+++ b/llvm/test/MC/PowerPC/aix-file-symbols.s
@@ -14,6 +14,6 @@
 # CHECK-NEXT: 00000000      df *DEBUG*	00000000 1.c
 # CHECK-NEXT: 00000000      df *DEBUG*	00000000 2.c
 # CHECK-NEXT: 00000000      df *DEBUG*	00000000 3.c
-# CHECK-NEXT: 00000000 l       .text	00000000 
+# CHECK-NEXT: 00000000 l     F .text	00000000 
 # CHECK-NEXT: 00000000 g     F .text (csect: ) 	00000000 .var1
 # CHECK-NEXT: 00000000 g     F .text (csect: ) 	00000000 .var2
diff --git a/llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-priority.ll b/llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-priority.ll
index 6db8451ea6a13b8..72c82fdc8b006f0 100644
--- a/llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-priority.ll
+++ b/llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-priority.ll
@@ -4,7 +4,10 @@
 ; CHECK: Disassembly of section .text:
 ; CHECK: 00000000 <.foo3>:
 ; CHECK: 00000020 <.foo4>:
-; CHECK: 00000040 <.foo>:
+
+;; FIXME: should show the function name instead of the section name.
+; CHECK: 00000040 <explicit_sec>:
+
 ; CHECK: 00000060 <.foo2>:
 
 define dso_local signext i32 @foo(i32 noundef signext %a) #0 section "explicit_sec" {
diff --git a/llvm/test/tools/llvm-objdump/XCOFF/symbol-table.test b/llvm/test/tools/llvm-objdump/XCOFF/symbol-table.test
index f8fc114f05a6206..109718e8552ae2d 100644
--- a/llvm/test/tools/llvm-objdump/XCOFF/symbol-table.test
+++ b/llvm/test/tools/llvm-objdump/XCOFF/symbol-table.test
@@ -68,7 +68,7 @@ entry:
 ; SYM:      SYMBOL TABLE:
 ; SYM-NEXT: 00000000      df *DEBUG*    00000000 <stdin>
 ; SYM-NEXT: 00000000         *UND*      00000000 ei
-; SYM-NEXT: 00000000 l       .text      00000091 
+; SYM-NEXT: 00000000 l     F .text      00000091 
 ; SYM-NEXT: 00000000 g     F .text (csect: )       00000000 .bar
 ; SYM-NEXT: 00000050 g     F .text (csect: )       00000000 .foo
 ; SYM-NEXT: 00000094 l       .text      00000013 L...str
@@ -90,7 +90,7 @@ entry:
 ; SYM-DES:      SYMBOL TABLE:
 ; SYM-DES-NEXT: 00000000      df *DEBUG*    00000000 (idx: 0) <stdin>
 ; SYM-DES-NEXT: 00000000         *UND*      00000000 (idx: 1) ei[UA]
-; SYM-DES-NEXT: 00000000 l       .text      00000091 (idx: 3) [PR]
+; SYM-DES-NEXT: 00000000 l     F .text      00000091 (idx: 3) [PR]
 ; SYM-DES-NEXT: 00000000 g     F .text (csect: (idx: 3) [PR])  00000000 (idx: 5) .bar
 ; SYM-DES-NEXT: 00000050 g     F .text (csect: (idx: 3) [PR])  00000000 (idx: 7) .foo
 ; SYM-DES-NEXT: 00000094 l       .text      00000013 (idx: 9) L...str[RO]
diff --git a/llvm/test/tools/llvm-symbolizer/xcoff-sd-symbol.ll b/llvm/test/tools/llvm-symbolizer/xcoff-sd-symbol.ll
index 781ac72933a1523..aedceb0227b8962 100644
--- a/llvm/test/tools/llvm-symbolizer/xcoff-sd-symbol.ll
+++ b/llvm/test/tools/llvm-symbolizer/xcoff-sd-symbol.ll
@@ -16,10 +16,10 @@ entry:
   ret void
 }
 
-; CHECK: ??
+; CHECK: .foo
 ; CHECK: ??:0:0
 ; CHECK-EMPTY:
 
-; CHECK: ??
+; CHECK: .foo1
 ; CHECK: ??:0:0
 ; CHECK-EMPTY:



More information about the llvm-commits mailing list