[PATCH] D52830: [ELF] - Set sh_info and sh_link for .rela.plt sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 02:09:06 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D52830#1253865, @ruiu wrote:

> In the commit message, please emphasize that this is what ELF spec requires, rather than emphasizing that GNU tools complain.


It's a bit uncovered part of the spec. As Ed mentioned, spec says "sh_link references the associated symbol table".
Technically, when we have only R_*_RELATIVE relocations in `.rela.plt` there is no '.dynsym' and hence no associated symbol table.
This patch assigns the index of `.symtab` then, but that should be useless for any tools as R_*_RELATIVE
just do not need symbols names and this assignment is a stub to suppress complaints.
That is why I did not say that it is **required** by ELF.

I'll update this patch with a better commit message.


https://reviews.llvm.org/D52830





More information about the llvm-commits mailing list