target/image: report error if ELF file contains no loadable sections
authorChristian Hoff <christian.hoff@advantest.com>
Tue, 20 Apr 2021 17:14:30 +0000 (19:14 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 1 May 2021 12:36:28 +0000 (13:36 +0100)
commit565129119f0dc345a6e7d16bb468ff15cb3b828d
tree91066164ea522f707a20801f615782ecb26fc875
parent9206bd243b0b594821ca96b37517b2e3de80dc39
target/image: report error if ELF file contains no loadable sections

The existing code asserted in that case, which is not correct. This
would allow the user to crash OpenOCD with a bad ELF file, which is
not what we want. A proper error should be reported in that case and
OpenOCD should not crash.

Change-Id: Ied5a6a6fd4ee0fd163f3fe850d304a121ecbe33a
Signed-off-by: Christian Hoff <christian.hoff@advantest.com>
Reviewed-on: http://openocd.zylin.com/6172
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/image.c