On Tue, Jul 28, 2009 at 8:40 AM, Daniel Jacobowitz wrote: > clear_solib (); > objfile_purge_solibs (); > > The problem with doing things in this order is that both the solib and > the objfile have a reference to the same BFD. The solib is > responsible for releasing it (OBJF_KEEPBFD). arm_objfile_data_cleanup > accesses objfile->obfd during free_objfile, to find the number > of sections; at that point it's already been free'd. That is a problem. > Any thoughts? There doesn't appear to be a correct order of destruction :-( Attached patch restores the original order, while still keeping solib_unloaded observers from accessing danglig objfiles. I do not know if there is a better way to fix this. Tested on Linux/x86_64 with no new regressions. Thanks, -- Paul Pluzhnikov 2009-07-29 Paul Pluzhnikov * solib.c (clear_solib): Rename to clear_solib_1 (clear_solib): New function. (no_shared_libraries): Adjust.