mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
97dc35c88d
Skip IFUNC relocations in debug sections ignored by ld.so. bfd/ PR ld/18808 * elf32-i386.c (elf_i386_relocate_section): Skip IFUNC relocations in debug sections. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. ld/testsuite/ PR ld/18808 * ld-ifunc/ifunc.exp: Add a test for PR ld/18808. * ld-ifunc/pr18808.out: New file. * ld-ifunc/pr18808a.c: Likewise. * ld-ifunc/pr18808b.c: Likewise.
25 lines
293 B
C
25 lines
293 B
C
int foo (int x) __attribute__ ((ifunc ("resolve_foo")));
|
|
extern void abort (void);
|
|
|
|
static int foo_impl(int x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
int bar()
|
|
{
|
|
int (*f)(int) = foo;
|
|
|
|
if (foo (5) != 5)
|
|
abort ();
|
|
|
|
if (f(42) != 42)
|
|
abort ();
|
|
}
|
|
|
|
|
|
void *resolve_foo (void)
|
|
{
|
|
return (void *) foo_impl;
|
|
}
|