forked from Imagelibrary/binutils-gdb
* ldmain.c (remove_output): Rename to..
(ld_cleanup): ..this. Call bfd_cache_close_all and plugin_call_cleanup. (main): Adjust. * plugin.c (plugin_call_cleanup): Make global. (plugin_load_plugins): Don't register plugin_call_cleanup with xatexit. * plugin.h (plugin_call_cleanup): Declare.
This commit is contained in:
17
ld/ldmain.c
17
ld/ldmain.c
@@ -174,15 +174,14 @@ static struct bfd_link_callbacks link_callbacks =
|
||||
struct bfd_link_info link_info;
|
||||
|
||||
static void
|
||||
remove_output (void)
|
||||
ld_cleanup (void)
|
||||
{
|
||||
if (output_filename)
|
||||
{
|
||||
if (link_info.output_bfd)
|
||||
bfd_cache_close (link_info.output_bfd);
|
||||
if (delete_output_file_on_failure)
|
||||
unlink_if_ordinary (output_filename);
|
||||
}
|
||||
bfd_cache_close_all ();
|
||||
#ifdef ENABLE_PLUGINS
|
||||
plugin_call_cleanup ();
|
||||
#endif
|
||||
if (output_filename && delete_output_file_on_failure)
|
||||
unlink_if_ordinary (output_filename);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -211,7 +210,7 @@ main (int argc, char **argv)
|
||||
|
||||
bfd_set_error_program_name (program_name);
|
||||
|
||||
xatexit (remove_output);
|
||||
xatexit (ld_cleanup);
|
||||
|
||||
/* Set up the sysroot directory. */
|
||||
ld_sysroot = get_sysroot (argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user