Yonghong Song
ce96738dee
bpf: print backward branch target properly
Currently, it prints the backward branch offset as unsigned value
like below:
7: 7d 34 0b 00 00 00 00 00 if r4 s>= r3 goto 11 <LBB0_3>
8: b7 00 00 00 00 00 00 00 r0 = 0
LBB0_2:
9: 07 00 00 00 01 00 00 00 r0 += 1
......
17: bf 31 00 00 00 00 00 00 r1 = r3
18: 6d 32 f6 ff 00 00 00 00 if r2 s> r3 goto 65526 <LBB0_3+0x7FFB0>
The correct print insn 18 should be:
18: 6d 32 f6 ff 00 00 00 00 if r2 s> r3 goto -10 <LBB0_2>
To provide better clarity and be consistent with kernel verifier output,
the insn 7 output is changed to the following with "+" added to
non-negative branch offset:
7: 7d 34 0b 00 00 00 00 00 if r4 s>= r3 goto +11 <LBB0_3>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318442
2017-11-16 19:15:36 +00:00
..
2017-09-11 23:43:35 +00:00
2017-09-11 23:43:35 +00:00
2017-09-11 23:43:35 +00:00
2017-09-11 22:59:45 +00:00
2017-09-11 23:43:35 +00:00
2017-01-17 07:26:17 +00:00
2017-09-18 23:29:36 +00:00
2017-09-28 02:46:11 +00:00
2017-09-11 23:43:35 +00:00
2017-04-13 22:24:13 +00:00
2017-11-16 19:15:36 +00:00
2017-11-16 19:15:36 +00:00
2017-09-28 02:46:11 +00:00
2017-01-17 07:26:17 +00:00
2017-05-03 17:30:56 +00:00
2017-06-29 15:18:54 +00:00
2017-06-29 15:18:54 +00:00
2017-09-09 00:11:13 +00:00
2017-09-09 00:11:13 +00:00
2017-06-16 15:41:16 +00:00
2017-06-16 15:41:16 +00:00
2017-09-11 23:43:35 +00:00
2017-10-16 04:14:53 +00:00
2017-08-23 04:25:57 +00:00
2017-09-09 00:11:13 +00:00
2017-01-17 07:26:17 +00:00
2017-04-10 20:18:21 +00:00