diff options
| author | Jean-Philippe Brucker <[email protected]> | 2020-09-30 09:36:01 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-10-01 01:11:40 +0000 |
| commit | 3effc06a4dde3e2f6ee3d82e59d97ec357802a4b (patch) | |
| tree | d6edcbdaf08cf0d95cf4ff3613ec2ef2a2cc4fbe /tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | |
| parent | selftests/bpf: Test "incremental" btf_dump in C format (diff) | |
| download | kernel-3effc06a4dde3e2f6ee3d82e59d97ec357802a4b.tar.gz kernel-3effc06a4dde3e2f6ee3d82e59d97ec357802a4b.zip | |
selftests/bpf: Fix alignment of .BTF_ids
Fix a build failure on arm64, due to missing alignment information for
the .BTF_ids section:
resolve_btfids.test.o: in function `test_resolve_btfids':
tools/testing/selftests/bpf/prog_tests/resolve_btfids.c:140:(.text+0x29c): relocation truncated to fit: R_AARCH64_LDST32_ABS_LO12_NC against `.BTF_ids'
ld: tools/testing/selftests/bpf/prog_tests/resolve_btfids.c:140: warning: one possible cause of this error is that the symbol is being referenced in the indicated code as if it had a larger alignment than was declared where it was defined
In vmlinux, the .BTF_ids section is aligned to 4 bytes by vmlinux.lds.h.
In test_progs however, .BTF_ids doesn't have alignment constraints. The
arm64 linker expects the btf_id_set.cnt symbol, a u32, to be naturally
aligned but finds it misaligned and cannot apply the relocation. Enforce
alignment of .BTF_ids to 4 bytes.
Fixes: cd04b04de119 ("selftests/bpf: Add set test to resolve_btfids")
Signed-off-by: Jean-Philippe Brucker <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c')
0 files changed, 0 insertions, 0 deletions
