ao-tools/ao-stmload: Be smarter about ELF parsing. Retry open on failure.
authorKeith Packard <keithp@keithp.com>
Sat, 23 Mar 2013 09:10:38 +0000 (02:10 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 31 Mar 2013 19:42:37 +0000 (12:42 -0700)
Figuring out what goes where is tricky; turns out we want to pull all
of the sections that map inside any program area that is supposed to
be loaded from the file.

So, we walk the program headers, then walk all of the section headers
looking for those that suck data from the same portion of the
file. Compute where in ROM each relevant section goes and build a full
ROM image in memory using that.

This patch also adds code to close and re-open the device if the first
open failed to do what we want. Much nicer to have the computer figure
out when the open succeeded rather than having people re-run the app.

Signed-off-by: Keith Packard <keithp@keithp.com>

No differences found