Do not emit a corrupt symbol table entry for .rela_iplt_{start,end}.
authorRui Ueyama <ruiu@google.com>
Tue, 15 Jan 2019 18:30:23 +0000 (18:30 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 15 Jan 2019 18:30:23 +0000 (18:30 +0000)
commit6f9d49cdde65898c3fbd74a7a98e7438216b0ba5
tree7c19800ff99af3629e13f51bc639162900b72f82
parent6f8eacfafce4e342fd0ca8e20172c767a3faadaa
Do not emit a corrupt symbol table entry for .rela_iplt_{start,end}.

If .rela.iplt does not exist, we used to emit a corrupt symbol table
that contains two symbols, .rela_iplt_{start,end}, pointing to a
nonexisting section.

This patch fixes the issue by setting section index 0 to the symbols
if .rel.iplt section does not exist.

Differential Revision: https://reviews.llvm.org/D56623

llvm-svn: 351218
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/ELF/Writer.cpp
lld/test/ELF/gnu-ifunc-empty.s [new file with mode: 0644]