Browse Source
Always call elf_backend_output_arch_local_syms since only the backend knows if elf_backend_output_arch_local_syms is needed when all symbols are striped. elf_backend_output_arch_local_syms is defined only for x86, ARM and AARCH64. On x86, elf_backend_output_arch_local_syms must be called to handle local IFUNC symbols even if all symbols are striped. Update ARM and AARCH64 to skip elf_backend_output_arch_local_syms when symbols aren't needed. bfd/ PR ld/29797 * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip if symbols aren't needed. * elfnn-aarch64.c (elfNN_aarch64_output_arch_local_syms): Likewise. * elflink.c (bfd_elf_final_link): Always call elf_backend_output_arch_local_syms if available. ld/ PR ld/29797 * testsuite/ld-elf/linux-x86.exp: Run PR ld/29797 test. * testsuite/ld-elf/pr29797.c: New file.gdb-13-branch
5 changed files with 47 additions and 2 deletions
@ -0,0 +1,21 @@ |
|||
#include <stdio.h> |
|||
|
|||
static int foo (int x) __attribute__ ((ifunc ("resolve_foo"))); |
|||
|
|||
static int foo_impl(int x) |
|||
{ |
|||
return x; |
|||
} |
|||
|
|||
static void *resolve_foo (void) |
|||
{ |
|||
return (void *) foo_impl; |
|||
} |
|||
|
|||
int |
|||
main () |
|||
{ |
|||
foo (0); |
|||
puts ("PASS"); |
|||
return 0; |
|||
} |
|||
Loading…
Reference in new issue