mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
5f7cbeec7d
* ld-ifunc/ifunc.exp: Run ifunc-main. * ld-ifunc/ifunc-lib.c: New file. * ld-ifunc/ifunc-main.c: Likewise. * ld-ifunc/ifunc-main.out: Likewise.
30 lines
352 B
C
30 lines
352 B
C
static int
|
|
one (void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static int
|
|
minus_one (void)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
void * foo_ifunc (void) __asm__ ("foo");
|
|
__asm__(".type foo, %gnu_indirect_function");
|
|
|
|
void *
|
|
foo_ifunc (void)
|
|
{
|
|
return one;
|
|
}
|
|
|
|
void * bar_ifunc (void) __asm__ ("bar");
|
|
__asm__(".type bar, %gnu_indirect_function");
|
|
|
|
void *
|
|
bar_ifunc (void)
|
|
{
|
|
return minus_one;
|
|
}
|