[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 11:11:34 PDT 2016
emaste added inline comments.
================
Comment at: ELF/OutputSections.cpp:1421
@@ -1420,2 +1420,3 @@
this->Header.sh_entsize = sizeof(Elf_Versym);
+ this->Header.sh_link = Out<ELFT>::DynSymTab->SectionIndex;
}
----------------
ruiu wrote:
> Please add a comment saying that setting sh_link is not required by any spec but we do since readelf assumes it.
It is actually required (in the link I posted above). I just think it's also a bug in readelf.
versym sh_link has to point to .dynsym per above, while I believe verdef and verneed do not have to (but in practice always do), while readelf relies on all three pointing to .dynsym.
http://reviews.llvm.org/D20956
More information about the llvm-commits
mailing list