Call xatexit with plugin_call_cleanup.
2010-12-06 H.J. Lu <hongjiu.lu@intel.com> Dmitry Gorbachev <d.g.gorbachev@gmail.com> PR ld/12289 * ldmain.c (main): Don't call plugin_call_cleanup. * plugin.c (plugin_call_cleanup): Make it static. (message): Don't call plugin_call_cleanup. (plugin_load_plugins): Call xatexit with plugin_call_cleanup.
This commit is contained in:
parent
3b8525f821
commit
e73d965c22
4 changed files with 20 additions and 16 deletions
10
ld/ChangeLog
10
ld/ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2010-12-06 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
Dmitry Gorbachev <d.g.gorbachev@gmail.com>
|
||||||
|
|
||||||
|
PR ld/12289
|
||||||
|
* ldmain.c (main): Don't call plugin_call_cleanup.
|
||||||
|
|
||||||
|
* plugin.c (plugin_call_cleanup): Make it static.
|
||||||
|
(message): Don't call plugin_call_cleanup.
|
||||||
|
(plugin_load_plugins): Call xatexit with plugin_call_cleanup.
|
||||||
|
|
||||||
2010-12-05 H.J. Lu <hongjiu.lu@intel.com>
|
2010-12-05 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR ld/12289
|
PR ld/12289
|
||||||
|
|
|
@ -479,13 +479,6 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
lang_finish ();
|
lang_finish ();
|
||||||
|
|
||||||
#ifdef ENABLE_PLUGINS
|
|
||||||
/* Now everything is finished, we can tell the plugins to clean up. */
|
|
||||||
if (plugin_call_cleanup ())
|
|
||||||
info_msg (_("%P: %s: error in plugin cleanup (ignored)\n"),
|
|
||||||
plugin_error_plugin ());
|
|
||||||
#endif /* ENABLE_PLUGINS */
|
|
||||||
|
|
||||||
/* Even if we're producing relocatable output, some non-fatal errors should
|
/* Even if we're producing relocatable output, some non-fatal errors should
|
||||||
be reported in the exit status. (What non-fatal errors, if any, do we
|
be reported in the exit status. (What non-fatal errors, if any, do we
|
||||||
want to ignore for relocatable output?) */
|
want to ignore for relocatable output?) */
|
||||||
|
|
16
ld/plugin.c
16
ld/plugin.c
|
@ -108,6 +108,9 @@ static bfd_boolean no_more_claiming = FALSE;
|
||||||
TRUE is returned from the hook. */
|
TRUE is returned from the hook. */
|
||||||
static bfd_boolean plugin_cached_allow_multiple_defs = FALSE;
|
static bfd_boolean plugin_cached_allow_multiple_defs = FALSE;
|
||||||
|
|
||||||
|
/* Call 'cleanup' hook for all plugins at exit. */
|
||||||
|
static void plugin_call_cleanup (void);
|
||||||
|
|
||||||
/* List of tags to set in the constant leading part of the tv array. */
|
/* List of tags to set in the constant leading part of the tv array. */
|
||||||
static const enum ld_plugin_tag tv_header_tags[] =
|
static const enum ld_plugin_tag tv_header_tags[] =
|
||||||
{
|
{
|
||||||
|
@ -590,9 +593,6 @@ message (int level, const char *format, ...)
|
||||||
char *newfmt = ACONCAT ((level == LDPL_FATAL
|
char *newfmt = ACONCAT ((level == LDPL_FATAL
|
||||||
? "%P%F: " : "%P%X: ",
|
? "%P%F: " : "%P%X: ",
|
||||||
format, "\n", NULL));
|
format, "\n", NULL));
|
||||||
if (plugin_call_cleanup ())
|
|
||||||
info_msg (_("%P: %s: error in plugin cleanup (ignored)\n"),
|
|
||||||
plugin_error_plugin ());
|
|
||||||
vfinfo (stderr, newfmt, args, TRUE);
|
vfinfo (stderr, newfmt, args, TRUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -716,6 +716,8 @@ plugin_load_plugins (void)
|
||||||
if (!curplug)
|
if (!curplug)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
xatexit (plugin_call_cleanup);
|
||||||
|
|
||||||
/* First pass over plugins to find max # args needed so that we
|
/* First pass over plugins to find max # args needed so that we
|
||||||
can size and allocate the tv array. */
|
can size and allocate the tv array. */
|
||||||
while (curplug)
|
while (curplug)
|
||||||
|
@ -812,8 +814,8 @@ plugin_call_all_symbols_read (void)
|
||||||
return plugin_error_p () ? -1 : 0;
|
return plugin_error_p () ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call 'cleanup' hook for all plugins. */
|
/* Call 'cleanup' hook for all plugins at exit. */
|
||||||
int
|
static void
|
||||||
plugin_call_cleanup (void)
|
plugin_call_cleanup (void)
|
||||||
{
|
{
|
||||||
plugin_t *curplug = plugins_list;
|
plugin_t *curplug = plugins_list;
|
||||||
|
@ -832,7 +834,9 @@ plugin_call_cleanup (void)
|
||||||
}
|
}
|
||||||
curplug = curplug->next;
|
curplug = curplug->next;
|
||||||
}
|
}
|
||||||
return plugin_error_p () ? -1 : 0;
|
if (plugin_error_p ())
|
||||||
|
info_msg (_("%P: %s: error in plugin cleanup (ignored)\n"),
|
||||||
|
plugin_error_plugin ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lazily init the non_ironly hash table. */
|
/* Lazily init the non_ironly hash table. */
|
||||||
|
|
|
@ -50,9 +50,6 @@ extern int plugin_call_claim_file (const struct ld_plugin_input_file *file,
|
||||||
/* Call 'all symbols read' hook for all plugins. */
|
/* Call 'all symbols read' hook for all plugins. */
|
||||||
extern int plugin_call_all_symbols_read (void);
|
extern int plugin_call_all_symbols_read (void);
|
||||||
|
|
||||||
/* Call 'cleanup' hook for all plugins. */
|
|
||||||
extern int plugin_call_cleanup (void);
|
|
||||||
|
|
||||||
/* Generate a dummy BFD to represent an IR file, for any callers of
|
/* Generate a dummy BFD to represent an IR file, for any callers of
|
||||||
plugin_call_claim_file to use as the handle in the ld_plugin_input_file
|
plugin_call_claim_file to use as the handle in the ld_plugin_input_file
|
||||||
struct that they build to pass in. The BFD is initially writable, so
|
struct that they build to pass in. The BFD is initially writable, so
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue