ifunc-sel.h 430 B

12345678910111213141516171819202122232425262728
  1. /* Used by the elf ifunc tests. */
  2. #ifndef ELF_IFUNC_SEL_H
  3. #define ELF_IFUNC_SEL_H 1
  4. extern int global;
  5. static inline void *
  6. inhibit_stack_protector
  7. ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
  8. {
  9. switch (global)
  10. {
  11. case 1:
  12. return f1;
  13. case -1:
  14. return f2;
  15. default:
  16. return f3;
  17. }
  18. }
  19. static inline void *
  20. inhibit_stack_protector
  21. ifunc_one (int (*f1) (void))
  22. {
  23. return f1;
  24. }
  25. #endif