If a function symbol only get its address by la.global, without
directly called by bl instruction, the PLT entry is not required.
bfd/ChangeLog:
* elfnn-loongarch.c (loongarch_elf_adjust_dynamic_symbol): Fix PLT
entry generate bug.
ld/ChangeLog:
* testsuite/ld-elf/shared.exp: Clear xfail for LoongArch.
(although we could actually do it here). */
if (h->type == STT_FUNC || h->type == STT_GNU_IFUNC || h->needs_plt)
{
- if (h->plt.refcount < 0
+ if (h->plt.refcount <= 0
|| (h->type != STT_GNU_IFUNC
&& (SYMBOL_REFERENCES_LOCAL (info, h)
|| (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
h->plt.offset = MINUS_ONE;
h->needs_plt = 0;
}
- else
- h->needs_plt = 1;
return true;
}
# but that is just an optimization so don't complain loudly.
setup_xfail *-*-*
clear_xfail alpha-*-* bfin-*-linux* csky-*-* frv-*-* hppa*-*-* i?86-*-*
-clear_xfail ia64-*-* microblaze-*-* powerpc*-*-* x86_64-*-* xtensa-*-*
+clear_xfail ia64-*-* loongarch*-*-* microblaze-*-* powerpc*-*-* x86_64-*-*
+clear_xfail xtensa-*-*
run_ld_link_tests {
{"pr22374 function pointer initialization"
"" "tmpdir/pr22374.so" "" "pr22374a.s"