]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/ifuncmain5.c
Add NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from Linux 5.1 to elf.h.
[thirdparty/glibc.git] / elf / ifuncmain5.c
CommitLineData
3c30afc8
L
1/* Test STT_GNU_IFUNC symbols with dynamic function pointer only. */
2
3#include <stdlib.h>
4
3c30afc8
L
5extern int foo (void);
6extern int foo_protected (void);
7
8typedef int (*foo_p) (void);
9
10foo_p
11__attribute__ ((noinline))
12get_foo (void)
13{
14 return foo;
15}
16
17foo_p
18__attribute__ ((noinline))
19get_foo_protected (void)
20{
21 return foo_protected;
22}
23
24int
25main (void)
26{
27 foo_p p;
e364e6f1 28
3c30afc8
L
29 p = get_foo ();
30 if ((*p) () != -1)
31 abort ();
32
33 p = get_foo_protected ();
34 if ((*p) () != 0)
35 abort ();
36
37 return 0;
38}