about summary refs log tree commit diff
path: root/sysdeps/generic/elf/ifunc-sel.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/elf/ifunc-sel.h')
-rw-r--r--sysdeps/generic/elf/ifunc-sel.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/generic/elf/ifunc-sel.h b/sysdeps/generic/elf/ifunc-sel.h
new file mode 100644
index 0000000000..6a27b69c5b
--- /dev/null
+++ b/sysdeps/generic/elf/ifunc-sel.h
@@ -0,0 +1,26 @@
+/* Used by the elf ifunc tests.  */
+#ifndef ELF_IFUNC_SEL_H
+#define ELF_IFUNC_SEL_H 1
+
+extern int global;
+
+static inline void *
+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 *
+ifunc_one (int (*f1) (void))
+{
+  return f1;
+}
+#endif