This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj/obj2yaml] - Improve dumping/creating of ELF versioning sections.
ClosedPublic

Authored by grimar on Jan 19 2021, 2:05 AM.

Details

Summary

This makes the following improvements.

For SHT_GNU_versym:

  • yaml2obj: set sh_link to index of .dynsym section automatically.

For SHT_GNU_verdef:

  • yaml2obj: set sh_link to index of .dynstr section automatically.
  • yaml2obj: set sh_info field automatically.
  • obj2yaml: don't dump the Info field when its value matches the number of version definitions.

For SHT_GNU_verneed:

  • yaml2obj: set sh_link to index of .dynstr section automatically.
  • yaml2obj: set sh_info field automatically.
  • obj2yaml: don't dump the Info field when its value matches the number of version dependencies.

Also, simplifies few test cases.

Diff Detail

Event Timeline

grimar created this revision.Jan 19 2021, 2:05 AM
grimar requested review of this revision.Jan 19 2021, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 2:05 AM

Looks to me like you need additional testing for when .dynsym or .dynstr are either not emitted at all, or are excluded from the section header table.

grimar updated this revision to Diff 317555.Jan 19 2021, 7:05 AM
  • Added test cases.
This revision is now accepted and ready to land.Jan 20 2021, 12:35 AM