[PATCH] D155353: [llvm-readobj] Print <null> for relocation target with an empty name

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 00:04:33 PDT 2023


jhenderson added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:6953-6954
   StringRef SymbolName = RelSym.Name;
+  if (RelSym.Sym && RelSym.Name.empty())
+    SymbolName = "<null>";
   SmallString<32> RelocName;
----------------
MaskRay wrote:
> jhenderson wrote:
> > If I'm not mistaken, we don't actually have a dedicated test case for this bit of the logic? (It's covered by other tests, but more by accident than design, I feel - there's no purpose-written llvm-readobj LLVM style test).
> There is a dedicated test: 	reloc-zero-name-or-value.test  from D81842
That only covers GNU style though, if I'm not mistaken (it uses llvm-readelf with no --elf-output-style option). We should have an LLVM style version, no? I.e. something equivalent to the reloc-zero-name-or-value.test that uses LLVM style that shows the behaviour change highlighted by "llvm/test/tools/yaml2obj/ELF/symbol-name.yaml".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155353/new/

https://reviews.llvm.org/D155353



More information about the llvm-commits mailing list