[ELF][MC] Set types of aliases of IFunc to STT_GNU_IFUNC
authorFangrui Song <maskray@google.com>
Sat, 7 Sep 2019 14:58:47 +0000 (14:58 +0000)
committerFangrui Song <maskray@google.com>
Sat, 7 Sep 2019 14:58:47 +0000 (14:58 +0000)
commit72e99e63a2f9b51853cf74eddae37d7eaf106ca5
tree75ef84b3ee3162fc67b0162d61cb16cb54d7aaa7
parent4e76f880723a4a1a25a94f556aea72f63da8f17a
[ELF][MC] Set types of aliases of IFunc to STT_GNU_IFUNC

```
.type  foo,@gnu_indirect_function
.set   foo,foo_resolver

.set foo2,foo
.set foo3,foo2
```

The types of foo2 and foo3 should be STT_GNU_IFUNC, but we currently
resolve them to the type of foo_resolver. This patch fixes it.

Differential Revision: https://reviews.llvm.org/D67206
Patch by Senran Zhang

llvm-svn: 371312
llvm/lib/MC/ELFObjectWriter.cpp
llvm/test/MC/ELF/ifunc-alias.s [new file with mode: 0644]