[PATCH] D73096: [llvm-readobj] - Rewrite gnuhash.test test to stop using precompiled objects.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 01:22:25 PST 2020


grimar marked 2 inline comments as done.
grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnuhash.test:47
+        Value: 0x0
+DynamicSymbols:
+  - Name:    aaa
----------------
jhenderson wrote:
> Are the dynamic symbols needed for the test?
Yes, because the current implementation uses the information about number of them:

```
template <typename ELFT> void ELFDumper<ELFT>::printGnuHashTable() {
....
   Elf_Sym_Range Syms = dynamic_symbols();
   unsigned NumSyms = std::distance(Syms.begin(), Syms.end());
   if (!NumSyms)
     reportError(createError("No dynamic symbol section"), ObjF->getFileName());
   W.printHexList("Values", GnuHashTable->values(NumSyms));
 }
```

Such implementation implies, that if I add a one more - a garbage will be dumped:

```
Values: [0x8, 0x9, 0xA, 0xB, 0x6FFFFEF5]
```

I think it is a bug. We should either error out or don't print garbage values and warn this case instead.
I am going to fix this.


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

https://reviews.llvm.org/D73096





More information about the llvm-commits mailing list