tools, bpf_asm: Warn when jumps are out of range
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 7 Nov 2019 10:03:49 +0000 (11:03 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 7 Nov 2019 15:01:34 +0000 (16:01 +0100)
commit7e22077d0c73a68ff3fd8b3d2f6564fcbcf8cb23
tree341749de11e136cd25048774bc1ccbc765172fbf
parent85d31dd07002315c0d1816543fdc392c8cc6b73a
tools, bpf_asm: Warn when jumps are out of range

When compiling larger programs with bpf_asm, it's possible to
accidentally exceed jt/jf range, in which case it won't complain, but
rather silently emit a truncated offset, leading to a "happy debugging"
situation.

Add a warning to help detecting such issues. It could be made an error
instead, but this might break compilation of existing code (which might
be working by accident).

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191107100349.88976-1-iii@linux.ibm.com
tools/bpf/bpf_exp.y