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.
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))