xref: /dflybsd-src/contrib/binutils-2.34/ld/plugin.h (revision b52ef7118d1621abed722c5bbbd542210290ecef)
1*fae548d3Szrj /* Plugin control for the GNU linker.
2*fae548d3Szrj    Copyright (C) 2010-2020 Free Software Foundation, Inc.
3*fae548d3Szrj 
4*fae548d3Szrj    This file is part of the GNU Binutils.
5*fae548d3Szrj 
6*fae548d3Szrj    This program is free software; you can redistribute it and/or modify
7*fae548d3Szrj    it under the terms of the GNU General Public License as published by
8*fae548d3Szrj    the Free Software Foundation; either version 3 of the License, or
9*fae548d3Szrj    (at your option) any later version.
10*fae548d3Szrj 
11*fae548d3Szrj    This program is distributed in the hope that it will be useful,
12*fae548d3Szrj    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*fae548d3Szrj    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*fae548d3Szrj    GNU General Public License for more details.
15*fae548d3Szrj 
16*fae548d3Szrj    You should have received a copy of the GNU General Public License
17*fae548d3Szrj    along with this program; if not, write to the Free Software
18*fae548d3Szrj    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19*fae548d3Szrj    MA 02110-1301, USA.  */
20*fae548d3Szrj 
21*fae548d3Szrj #ifndef GLD_PLUGIN_H
22*fae548d3Szrj #define GLD_PLUGIN_H
23*fae548d3Szrj 
24*fae548d3Szrj /* Report plugin symbols.  */
25*fae548d3Szrj extern bfd_boolean report_plugin_symbols;
26*fae548d3Szrj 
27*fae548d3Szrj /* Set at all symbols read time, to avoid recursively offering the plugin
28*fae548d3Szrj    its own newly-added input files and libs to claim.  */
29*fae548d3Szrj extern bfd_boolean no_more_claiming;
30*fae548d3Szrj 
31*fae548d3Szrj /* This is the only forward declaration we need to avoid having
32*fae548d3Szrj    to include the plugin-api.h header in order to use this file.  */
33*fae548d3Szrj struct ld_plugin_input_file;
34*fae548d3Szrj 
35*fae548d3Szrj /* Handle -plugin arg: find and load plugin.  */
36*fae548d3Szrj extern void plugin_opt_plugin (const char *plugin);
37*fae548d3Szrj 
38*fae548d3Szrj /* Accumulate option arguments for last-loaded plugin, or return
39*fae548d3Szrj    error if none.  */
40*fae548d3Szrj extern int plugin_opt_plugin_arg (const char *arg);
41*fae548d3Szrj 
42*fae548d3Szrj /* Load up and initialise all plugins after argument parsing.  */
43*fae548d3Szrj extern void plugin_load_plugins (void);
44*fae548d3Szrj 
45*fae548d3Szrj /* Return name of plugin which caused an error in any of the above.  */
46*fae548d3Szrj extern const char *plugin_error_plugin (void);
47*fae548d3Szrj 
48*fae548d3Szrj /* Call 'claim file' hook for all plugins.  */
49*fae548d3Szrj extern void plugin_maybe_claim (lang_input_statement_type *);
50*fae548d3Szrj 
51*fae548d3Szrj /* Call 'all symbols read' hook for all plugins.  */
52*fae548d3Szrj extern int plugin_call_all_symbols_read (void);
53*fae548d3Szrj 
54*fae548d3Szrj /* Call 'cleanup' hook for all plugins at exit.  */
55*fae548d3Szrj extern void plugin_call_cleanup (void);
56*fae548d3Szrj 
57*fae548d3Szrj #endif /* !def GLD_PLUGIN_H */
58