This rewrites the test to use YAML and removes 4 precomipled object.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I've also added tests for llvm-readelf to document the behavior,
though I do not understand why it accepts --gnu-hash-table.
GNU readelf does not. Is it a bug?
LGTM.
I wouldn't call it a bug. Rather, it's a feature. If you just want to dump the contents of the .gnu.hash section (and not the .hash section), you need this sort of switch. I think it's okay for us to have switches that are not accepted in GNU readelf, as long as the switch names are (relatively) unlikely to be used by GNU for something else in the future. I do however find it weird that the GNU and LLVM styles match.
llvm/test/tools/llvm-readobj/ELF/gnuhash.test | ||
---|---|---|
47 | Are the dynamic symbols needed for the test? |
llvm/test/tools/llvm-readobj/ELF/gnuhash.test | ||
---|---|---|
47 | 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. |
Are the dynamic symbols needed for the test?