Skip to content

Commit ffc8817

Browse files
anakryikoAlexei Starovoitov
authored and
Alexei Starovoitov
committed
selftests/bpf: Ensure no DWARF relocations for BPF object files
Add -mattr=dwarfris attribute to llc to avoid having relocations against DWARF data. These relocations make it impossible to inspect DWARF contents: all strings are invalid. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a8fdaad commit ffc8817

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ $(OUTPUT)/flow_dissector_load.o: flow_dissector_load.h
161161
define CLANG_BPF_BUILD_RULE
162162
($(CLANG) $3 -O2 -target bpf -emit-llvm \
163163
-c $1 -o - || echo "BPF obj compilation failed") | \
164-
$(LLC) -march=bpf -mcpu=probe $4 -filetype=obj -o $2
164+
$(LLC) -mattr=dwarfris -march=bpf -mcpu=probe $4 -filetype=obj -o $2
165165
endef
166166
# Similar to CLANG_BPF_BUILD_RULE, but with disabled alu32
167167
define CLANG_NOALU32_BPF_BUILD_RULE

0 commit comments

Comments
 (0)