Skip to content

Commit 33f32e5

Browse files
nathanchanceborkmann
authored andcommitted
bpf, arm64: Mark dummy_tramp as global
When building with clang + CONFIG_CFI_CLANG=y, the following error occurs at link time: ld.lld: error: undefined symbol: dummy_tramp dummy_tramp is declared globally in C but its definition in inline assembly does not use .global, which prevents clang from properly resolving the references to it when creating the CFI jump tables. Mark dummy_tramp as global so that the reference can be properly resolved. Fixes: b2ad54e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") Suggested-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Stanislav Fomichev <sdf@google.com> Link: ClangBuiltLinux/linux#1661 Link: https://lore.kernel.org/bpf/20220713173503.3889486-1-nathan@kernel.org
1 parent 94bf6aa commit 33f32e5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ void dummy_tramp(void);
604604

605605
asm (
606606
" .pushsection .text, \"ax\", @progbits\n"
607+
" .global dummy_tramp\n"
607608
" .type dummy_tramp, %function\n"
608609
"dummy_tramp:"
609610
#if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)

0 commit comments

Comments
 (0)