summary refs log tree commit diff
path: root/sysdeps/generic/ifunc-sel.h
blob: 1fff4059ccb05bf181672f7cbb3c9b32bb2f096d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Used by the elf ifunc tests.  */
#ifndef ELF_IFUNC_SEL_H
#define ELF_IFUNC_SEL_H 1

extern int global;

static inline void *
inhibit_stack_protector
ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
{
 switch (global)
   {
   case 1:
     return f1;
   case -1:
     return f2;
   default:
     return f3;
   }
}

static inline void *
inhibit_stack_protector
ifunc_one (int (*f1) (void))
{
  return f1;
}
#endif