HomePhabricator

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

Authored by grimar on Jan 18 2021, 6:42 AM.

Description

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

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.

Differential revision: https://reviews.llvm.org/D94956