Revert "target/image: zero-initialize ELF segments up to p_memsz"
commit144d940a8b0276d2ecb97ee6615d8a78faf4117d
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 6 May 2023 09:44:53 +0000 (6 11:44 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 27 May 2023 06:38:12 +0000 (27 06:38 +0000)
tree6fbe8a4ef408b3ce4bf881d8c6d637d26227d7ce
parenta5d34202c6880bc9b8d0b326628ba1f2e5b061ff
Revert "target/image: zero-initialize ELF segments up to p_memsz"

This reverts commit 047b1a8fc237af480e3bab66a9827a358afd7547.

Commit 047b1a8fc237 ("target/image: zero-initialize ELF segments
up to p_memsz") breaks the backward compatibility introducing some
problem:
- an empty bss segment with paddr in SRAM gets zero filled at load
  but does not survive after a reset, causing verify to fail;
- an empty bss segment with paddr in FLASH causes excessive flash
  usage, which can exceed flash size (causing error) and makes
  flash aging faster.

Revert it while looking for a better implementation.

Change-Id: Iaaf926dafce46a220a5bbe20c8576eb449996d76
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7658
Reviewed-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-by: Peter Collingbourne <pcc@google.com>
Tested-by: jenkins
src/target/image.c