Blame sysdeps/generic/ifunc-sel.h
|
Packit Service |
82fcde |
/* Used by the elf ifunc tests. */
|
|
Packit Service |
82fcde |
#ifndef ELF_IFUNC_SEL_H
|
|
Packit Service |
82fcde |
#define ELF_IFUNC_SEL_H 1
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
extern int global;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
static inline void *
|
|
Packit Service |
82fcde |
inhibit_stack_protector
|
|
Packit Service |
82fcde |
ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
switch (global)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
case 1:
|
|
Packit Service |
82fcde |
return f1;
|
|
Packit Service |
82fcde |
case -1:
|
|
Packit Service |
82fcde |
return f2;
|
|
Packit Service |
82fcde |
default:
|
|
Packit Service |
82fcde |
return f3;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
static inline void *
|
|
Packit Service |
82fcde |
inhibit_stack_protector
|
|
Packit Service |
82fcde |
ifunc_one (int (*f1) (void))
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
return f1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
#endif
|