This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Don't crash when checking the number of dynamic symbols.
ClosedPublic

Authored by grimar on Jun 30 2020, 7:20 AM.

Details

Summary

When we deriving the number of symbols from the DT_HASH table, we can crash when
calculate the number of symbols in the symbol table when SHT_DYNSYM
has sh_entsize == 0.

The patch fixes the issue.

Diff Detail

Event Timeline

grimar created this revision.Jun 30 2020, 7:20 AM
Herald added a project: Restricted Project. · View Herald Transcript
jhenderson accepted this revision.Jul 1 2020, 1:47 AM

Couple of nits, otherwise LGTM.

llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test
163

null -> zero

Also below in file names.

251

I'd change "is no-op" to "is the standard entsize value"

This revision is now accepted and ready to land.Jul 1 2020, 1:47 AM
This revision was automatically updated to reflect the committed changes.
grimar marked 2 inline comments as done.