]> granicus.if.org Git - llvm/commit
[MC][ELF] Don't create relocations with section symbols for STB_LOCAL ifunc
authorFangrui Song <maskray@google.com>
Fri, 7 Jun 2019 03:47:22 +0000 (03:47 +0000)
committerFangrui Song <maskray@google.com>
Fri, 7 Jun 2019 03:47:22 +0000 (03:47 +0000)
commit5a518b5d5eda26061b8a7770e1e80211eea65c51
tree0a897c8ab360efc4fe22d5e3a5c6a8198d598f38
parentaca7c10dd7d0dde054dbe51bb390a068487f2ba4
[MC][ELF] Don't create relocations with section symbols for STB_LOCAL ifunc

We should keep the symbol type (STT_GNU_IFUNC) for a local ifunc because
it may result in an IRELATIVE reloc that the dynamic loader will use to
resolve the address at startup time.

There is another problem that is not fixed by this patch: a PC relative
relocation should also create a relocation with the ifunc symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362767 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/ELFObjectWriter.cpp
test/MC/ELF/ifunc-reloc.s