]> git.ipfire.org Git - thirdparty/linux.git/commit
libbpf: Turn relo_core->sym_off unsigned
authorEmil Tsalapatis <emil@etsalapatis.com>
Tue, 16 Dec 2025 17:33:23 +0000 (12:33 -0500)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 16 Dec 2025 18:42:55 +0000 (10:42 -0800)
commit0aa721437e4b74d737f58582f1bbf2eea3e038c7
treed61f0206a4fd00d997c883e692065dcbf91ba6ad
parent12a1fe6e12dbad39f2f0dad1a385625f0298eff4
libbpf: Turn relo_core->sym_off unsigned

The symbols' relocation offsets in BPF are stored in an int field,
but cannot actually be negative. When in the next patch libbpf relocates
globals to the end of the arena, it is also possible to have valid
offsets > 2GiB that are used to calculate the final relo offsets.
Avoid accidentally interpreting large offsets as negative by turning
the sym_off field unsigned.

Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20251216173325.98465-4-emil@etsalapatis.com
tools/lib/bpf/libbpf.c