xref: /linux/tools/testing/selftests/exec/binfmt_bpf_app.c (revision 277d787feb2edeb3adae81a99fc47294d523a106)
1*277d787fSFarid Zakaria // SPDX-License-Identifier: GPL-2.0
2*277d787fSFarid Zakaria /*
3*277d787fSFarid Zakaria  * A relocatable binary for the binfmt_misc_bpf $ORIGIN case. The Makefile
4*277d787fSFarid Zakaria  * links it with PT_INTERP set to the literal "$ORIGIN/binfmt_bpf_interp"
5*277d787fSFarid Zakaria  * (-Wl,--dynamic-linker), which the kernel ELF loader cannot resolve. The
6*277d787fSFarid Zakaria  * nix_origin bpf handler resolves it relative to this binary's directory and
7*277d787fSFarid Zakaria  * routes execution to the co-located interpreter.
8*277d787fSFarid Zakaria  */
9*277d787fSFarid Zakaria int main(void)
10*277d787fSFarid Zakaria {
11*277d787fSFarid Zakaria 	return 0;
12*277d787fSFarid Zakaria }
13