Commit | Line | Data |
---|---|---|
5d3236ee | 1 | /* Plugin control for the GNU linker. |
498cd2a0 | 2 | Copyright 2010, 2011 Free Software Foundation, Inc. |
5d3236ee DK |
3 | |
4 | This file is part of the GNU Binutils. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 3 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
19 | MA 02110-1301, USA. */ | |
20 | ||
21 | #ifndef GLD_PLUGIN_H | |
22 | #define GLD_PLUGIN_H | |
23 | ||
1715a13c L |
24 | /* Report plugin symbols. */ |
25 | extern bfd_boolean report_plugin_symbols; | |
5d3236ee DK |
26 | |
27 | /* This is the only forward declaration we need to avoid having | |
28 | to include the plugin-api.h header in order to use this file. */ | |
29 | struct ld_plugin_input_file; | |
30 | ||
31 | /* Handle -plugin arg: find and load plugin, or return error. */ | |
32 | extern int plugin_opt_plugin (const char *plugin); | |
33 | ||
34 | /* Accumulate option arguments for last-loaded plugin, or return | |
35 | error if none. */ | |
36 | extern int plugin_opt_plugin_arg (const char *arg); | |
37 | ||
d44ad554 DK |
38 | /* Return true if any plugins are active this run. Only valid |
39 | after options have been processed. */ | |
40 | extern bfd_boolean plugin_active_plugins_p (void); | |
41 | ||
5d3236ee DK |
42 | /* Load up and initialise all plugins after argument parsing. */ |
43 | extern int plugin_load_plugins (void); | |
44 | ||
45 | /* Return name of plugin which caused an error in any of the above. */ | |
46 | extern const char *plugin_error_plugin (void); | |
47 | ||
48 | /* Call 'claim file' hook for all plugins. */ | |
49 | extern int plugin_call_claim_file (const struct ld_plugin_input_file *file, | |
a48d02c9 | 50 | int *claimed); |
5d3236ee DK |
51 | |
52 | /* Call 'all symbols read' hook for all plugins. */ | |
53 | extern int plugin_call_all_symbols_read (void); | |
54 | ||
498cd2a0 AM |
55 | /* Call 'cleanup' hook for all plugins at exit. */ |
56 | extern void plugin_call_cleanup (void); | |
57 | ||
5d3236ee DK |
58 | /* Generate a dummy BFD to represent an IR file, for any callers of |
59 | plugin_call_claim_file to use as the handle in the ld_plugin_input_file | |
60 | struct that they build to pass in. The BFD is initially writable, so | |
61 | that symbols can be added to it; it must be made readable after the | |
62 | add_symbols hook has been called so that it can be read when linking. */ | |
63 | extern bfd *plugin_get_ir_dummy_bfd (const char *name, bfd *template); | |
64 | ||
5d3236ee DK |
65 | /* Notice-symbol bfd linker callback hook. */ |
66 | extern bfd_boolean plugin_notice (struct bfd_link_info *info, | |
8be6259e L |
67 | const char *name, bfd *abfd, |
68 | asection *section, bfd_vma value); | |
5d3236ee DK |
69 | |
70 | /* Multiple-definition bfd linker callback hook. */ | |
71 | extern bfd_boolean plugin_multiple_definition (struct bfd_link_info *info, | |
a48d02c9 | 72 | const char *name, |
8be6259e L |
73 | bfd *obfd, asection *osec, |
74 | bfd_vma oval, bfd *nbfd, | |
75 | asection *nsec, | |
76 | bfd_vma nval); | |
5d3236ee DK |
77 | |
78 | #endif /* !def GLD_PLUGIN_H */ |