Commit ddf5a25c authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Linus Torvalds

ARM: unwinder: fix bisection to find origin in .idx section

The bisection implemented in unwind_find_origin() stopped to early.  If
there is only a single entry left to check the original code just took
the end point as origin which might be wrong.

This was introduced in commit de66a979 ("ARM: 7187/1: fix unwinding
for XIP kernels").
Reported-and-tested-by: default avatarNick Bowler <nbowler@elliptictech.com>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 42ebfc61
......@@ -160,12 +160,12 @@ static const struct unwind_idx *unwind_find_origin(
const struct unwind_idx *start, const struct unwind_idx *stop)
{
pr_debug("%s(%p, %p)\n", __func__, start, stop);
while (start < stop - 1) {
while (start < stop) {
const struct unwind_idx *mid = start + ((stop - start) >> 1);
if (mid->addr_offset >= 0x40000000)
/* negative offset */
start = mid;
start = mid + 1;
else
/* positive offset */
stop = mid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment