diff options
author | Xi Ruoyao <xry111@xry111.site> | 2024-06-30 15:18:22 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2024-07-05 12:11:11 +0800 |
commit | 41ef0bff2033bb7b30a2792417aa946503492ce0 (patch) | |
tree | 9c18ea35d658259c1fe5315e98997207e2c9f831 /gprofng/src | |
parent | 1c31db21fe6555e1a9b2a33b95a0125250c517d8 (diff) | |
download | binutils-41ef0bff2033bb7b30a2792417aa946503492ce0.zip binutils-41ef0bff2033bb7b30a2792417aa946503492ce0.tar.gz binutils-41ef0bff2033bb7b30a2792417aa946503492ce0.tar.bz2 |
LoongArch: Fix bad reloc with mixed visibility ifunc symbols in shared libraries
With a simple test case:
.globl ifunc
.globl ifunc_hidden
.hidden ifunc_hidden
.type ifunc, %gnu_indirect_function
.type ifunc_hidden, %gnu_indirect_function
.text
.align 2
ifunc: ret
ifunc_hidden: ret
test:
bl ifunc
bl ifunc_hidden
"ld -shared" produces a shared object with one R_LARCH_NONE (instead of
R_LARCH_JUMP_SLOT as we expect) to relocate the GOT entry of "ifunc".
It's because the indices in .plt and .rela.plt mismatches for
STV_DEFAULT STT_IFUNC symbols when another PLT entry exists for a
STV_HIDDEN STT_IFUNC symbol, and such a mismatch breaks the logic of
loongarch_elf_finish_dynamic_symbol. Fix the issue by reordering .plt
so the indices no longer mismatch.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Diffstat (limited to 'gprofng/src')
0 files changed, 0 insertions, 0 deletions