summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/exec/binfmt_bpf_app.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/exec/binfmt_bpf_app.c')
-rw-r--r--tools/testing/selftests/exec/binfmt_bpf_app.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/testing/selftests/exec/binfmt_bpf_app.c b/tools/testing/selftests/exec/binfmt_bpf_app.c
new file mode 100644
index 000000000000..472270f148bc
--- /dev/null
+++ b/tools/testing/selftests/exec/binfmt_bpf_app.c
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * A relocatable binary for the binfmt_misc_bpf $ORIGIN case. The Makefile
+ * links it with PT_INTERP set to the literal "$ORIGIN/binfmt_bpf_interp"
+ * (-Wl,--dynamic-linker), which the kernel ELF loader cannot resolve. The
+ * nix_origin bpf handler resolves it relative to this binary's directory and
+ * routes execution to the co-located interpreter.
+ */
+int main(void)
+{
+ return 0;
+}