This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Print symbol version when dumping relocations (PR31564)
ClosedPublic

Authored by Higuoxing on Mar 9 2019, 5:15 AM.

Diff Detail

Event Timeline

Higuoxing created this revision.Mar 9 2019, 5:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2019, 5:15 AM
grimar added inline comments.Mar 11 2019, 3:41 AM
tools/llvm-readobj/ELFDumper.cpp
2709–2710

Seems you do not need this->

2710

nit: I suggest to add a comment fot the last arg: SymTab->sh_type == SHT_DYNSYM /* IsDynamic */

Higuoxing updated this revision to Diff 190074.Mar 11 2019, 5:58 AM

Addressed @grimar 's comments.

  • Add /* IsDynamic */ hints.
  • Sorry, I cannot find another way to get full name of a symbol. Is there another method?
Higuoxing marked an inline comment as done.Mar 11 2019, 5:59 AM
Higuoxing added inline comments.
tools/llvm-readobj/ELFDumper.cpp
2709–2710

Sorry, I cannot remove this, I cannot find another way to achieve this.

jhenderson added inline comments.Mar 12 2019, 3:07 AM
test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
78

Please use mangled names, to show that versioned symbols are demangled (e.g. _Z2f1v becomes f1()@v3 etc).

Higuoxing updated this revision to Diff 190237.Mar 12 2019, 4:33 AM

Addressed @jhenderson 's comments.

  • Use -demangle option to test that mangled name can be demangled correctly.
jhenderson added inline comments.Mar 12 2019, 6:29 AM
test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
2

Thinking about a past bug to do with symbol versioning, perhaps it's worth one of these symbols not having a version, to show that symbol versioning it only printed for symbols with version details?

Higuoxing added inline comments.Mar 12 2019, 6:41 AM
test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
2

Do you mean that a dynamic symbol that not included in .gnu.version/.gnu.version_d/.gnu.version_r section? Am I right?

jhenderson added inline comments.Mar 12 2019, 6:43 AM
test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
2

Yes, exactly.

Higuoxing updated this revision to Diff 190247.Mar 12 2019, 6:55 AM

Addressed @jhenderson 's comments

  • Add a dynamic symbol without versioning.
jhenderson accepted this revision.Mar 12 2019, 7:13 AM

LGTM.

test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
3–4

Nit: You don't need the --strict-whitespace switches.

This revision is now accepted and ready to land.Mar 12 2019, 7:13 AM
Higuoxing marked an inline comment as done.Mar 12 2019, 7:20 AM
Higuoxing added inline comments.
test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
3–4

Oh, Because my test cases are copied from terminal. Just to make sure the number of blanks are right. Forget to remove this flag.

LGTM.

Thanks for reviewing :)

This revision was automatically updated to reflect the committed changes.