[llvm] [llvm-objdump] Rework .gnu.version_d dumping (PR #128434)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 09:53:42 PST 2025


================
@@ -426,10 +394,26 @@ template <class ELFT> void ELFDumper<ELFT>::printSymbolVersion() {
         unwrapOrError(Elf.getSection(Shdr.sh_link), FileName);
     StringRef StrTab = unwrapOrError(Elf.getStringTable(*StrTabSec), FileName);
 
-    if (Shdr.sh_type == ELF::SHT_GNU_verneed)
+    if (Shdr.sh_type == ELF::SHT_GNU_verneed) {
       printSymbolVersionDependency(Shdr);
-    else
-      printSymbolVersionDefinition<ELFT>(Shdr, Contents, StrTab);
+    } else {
+      OS << "\nVersion definitions:\n";
----------------
MaskRay wrote:

To make the style similar to llvm-readobj and possibly switch to formatted_raw_ostream in the future like llvm-readobj (and llvm-objdump -d already uses formatted_raw_ostream).

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


More information about the llvm-commits mailing list