binutils-gdb/ld/testsuite/ld-ifunc/pr18808b.c
H.J. Lu 97dc35c88d Skip IFUNC relocations in debug sections
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.
2015-08-11 12:59:11 -07:00

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;
}