[PATCH] D20956: [ELF] - Assign sh_link field of SHT_GNU_versym section to DynSymTab section index

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 08:09:50 PDT 2016


emaste added a subscriber: emaste.
emaste accepted this revision.
emaste added a reviewer: emaste.
emaste added a comment.
This revision is now accepted and ready to land.

> I did not find anywhere in documentation that sh_link of this one should be set to something, but readelf using it:


ELF Tool Chain readelf collects the version strings from the verdef and verneed sections, without using the versym section sh_link. I think the GNU readelf source you linked to is actually a bug.

That said, from https://docs.oracle.com/cd/E19120-01/open.solaris/819-0690/chapter6-54676/index.html versym sh_link is indeed supposed to point to the .dynsym section:

> The number of elements of the array must equal the number of symbol table entries that are contained in the associated symbol table. This number is determined by the section's sh_link value.


I think it would be valid to have another string section (say, `.verstr`) and have the verdef/verneed sections reference it in sh_link. In that case versym sh_link still needs to be the dynsym section.


http://reviews.llvm.org/D20956





More information about the llvm-commits mailing list