From faf23d1302cd74ad961cf5b1c7311841e9f50b28 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 6 Jul 2010 19:08:28 +0400 Subject: [PATCH] outbin: Simplify reverse address computing Signed-off-by: Cyrill Gorcunov --- output/outbin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/outbin.c b/output/outbin.c index c9947132..6a90aa0d 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -545,8 +545,8 @@ static void bin_cleanup(int debuginfo) saa_fread(r->target->contents, r->posn, mydata, r->bytes); p = q = mydata; l = 0; - for (b = 0; b < r->bytes; b++) - l += p[b] << (b * 8); + for (b = r->bytes - 1; b >= 0; b--) + l = (l << 8) + p[b]; s = find_section_by_index(r->secref); if (s) { -- 2.11.4.GIT