>>>>> Eduard-Petru Jipa <ejipa@undo.io> writes:
> From: Eduard Jipa <ejipa@undo.io>
> When the set of shared libraries is reloaded, for example after
> 'set sysroot' or 'set solib-search-path', reload_shared_libraries_1
> calls solib_ops::bfd_open for each library in turn. This can throw an
> error, for example if the file found is not in executable format, or
> its architecture is not compatible with the target.
> Nothing in the loop catches that error, so a single bad library stops
> the whole reload. Any libraries after it in the list are not reloaded,
> and the error propagates out of the command that triggered the reload.
> Catch the error, print it, and carry on with the rest of the
> libraries. This matches what is already done for errors from
> solib_map_sections later in the same loop. The library that failed
> to open is handled as if it had not been found.
> Add a test that builds a sysroot in which the first of two libraries
> is not a valid object file, and checks that, after 'set sysroot', the
> first library is no longer loaded and the second library is reloaded
> from the new sysroot.
This looks good to me. Thank you for doing this.
Approved-By: Tom Tromey <tom@tromey.com>
Tom