From dfc0a89d1af98db9e1c5b6bbef874dc545eb1a08 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Sat, 28 Jun 2014 10:53:53 +0200 Subject: [PATCH] ddsect.sh: fix calculating END_ADDRESS Calculate the actual end address of the section, this way it could be reused in other memory layout files. Adjust also the size calculation, so that the value will be the same as before. --- ddsect.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ddsect.sh b/ddsect.sh index b1c5122..1a27e5f 100755 --- a/ddsect.sh +++ b/ddsect.sh @@ -34,11 +34,11 @@ parse_map_file() do RANGE=$(echo $line | cut -d ':' -f 1) START_ADDRESS=$(( $(echo $RANGE | cut -d '-' -f 1) )) - END_ADDRESS=$(( $(echo $RANGE | cut -d '-' -f 2) )) + END_ADDRESS=$(( $(echo $RANGE | cut -d '-' -f 2) - 1)) NAME=$(echo $line | cut -d ':' -f 2 | sed -e 's/^"//' -e 's/"$//') - SIZE=$(($END_ADDRESS - $START_ADDRESS)) + SIZE=$(($END_ADDRESS - $START_ADDRESS + 1)) SIZE_KiB=$(($SIZE / 1024)) -- 2.1.4