diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2021-04-03 09:03:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-04-13 09:48:27 +0200 |
commit | 9ac300c34b31213ca570c80c22bd55477ecd5700 (patch) | |
tree | c4b43c86a029cfe0f4d367fce21802a8962ad677 /dts/src/arm | |
parent | e4ee908a4f124f36c92c7d8712882c201c9165b3 (diff) | |
download | barebox-9ac300c34b31213ca570c80c22bd55477ecd5700.tar.gz barebox-9ac300c34b31213ca570c80c22bd55477ecd5700.tar.xz |
RISC-V: boot: uncompress: determine piggy data bounds before relocation
Like on ARM, the PBL common code does not relocate the piggy data and
instead keeps pointers into the old image's location.
For relocate_to_current_adr, this doesn't matter, because both
destination and source address are the same, but when running from ROM
or flash relocate_to_adr will only copy up to __bss_start, so
determining the piggy data bounds _must_ happen before relocation.
We did so, but input_data_len, which references the image end was
executed after relocation unearthing two bugs at once:
- The compiler cached input_data_end from before relocation, so
the runtime offset wasn't being added
- Even with runtime offset added, we were pointing at the new
address, but the old piggy data wasn't copied there (On erizo,
it's still in ROM)
Fix these by evaluating the bounds before relocation and add a comment,
why it needs to be there. The same comment will also be added at the
code's origin in the ARM architecture support.
Reported-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.pengutronix.de/20210403070332.3642879-1-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'dts/src/arm')
0 files changed, 0 insertions, 0 deletions