/src/binutils-gdb/bfd/plugin.h
Line | Count | Source |
1 | | /* Plugin support for BFD. |
2 | | Copyright (C) 2009-2026 Free Software Foundation, Inc. |
3 | | |
4 | | This file is part of BFD, the Binary File Descriptor library. |
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 _PLUGIN_H_ |
22 | | #define _PLUGIN_H_ |
23 | | |
24 | | struct ld_plugin_input_file; |
25 | | |
26 | | #if BFD_SUPPORTS_PLUGINS |
27 | | void bfd_plugin_set_program_name (const char *); |
28 | | int bfd_plugin_open_input (bfd *, struct ld_plugin_input_file *); |
29 | | void bfd_plugin_set_plugin (const char *); |
30 | | bool bfd_link_plugin_object_p (bfd *); |
31 | | void register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *, bool)); |
32 | | void bfd_plugin_close_file_descriptor (bfd *, int); |
33 | | |
34 | | static inline const bfd_target * |
35 | | bfd_plugin_vec (void) |
36 | 17.5M | { |
37 | 17.5M | extern const bfd_target plugin_vec; |
38 | 17.5M | return &plugin_vec; |
39 | 17.5M | } Line | Count | Source | 36 | 3 | { | 37 | 3 | extern const bfd_target plugin_vec; | 38 | 3 | return &plugin_vec; | 39 | 3 | } |
Unexecuted instantiation: archive.c:bfd_plugin_vec Line | Count | Source | 36 | 17.5M | { | 37 | 17.5M | extern const bfd_target plugin_vec; | 38 | 17.5M | return &plugin_vec; | 39 | 17.5M | } |
Unexecuted instantiation: elflink.c:bfd_plugin_vec Unexecuted instantiation: plugin.c:bfd_plugin_vec Unexecuted instantiation: fuzz_ranlib_simulation.c:bfd_plugin_vec Unexecuted instantiation: fuzz_objcopy.c:bfd_plugin_vec |
40 | | |
41 | | static inline bool |
42 | | bfd_plugin_target_p (const bfd_target *target) |
43 | 17.3M | { |
44 | 17.3M | return target == bfd_plugin_vec (); |
45 | 17.3M | } fuzz_nm.c:bfd_plugin_target_p Line | Count | Source | 43 | 3 | { | 44 | 3 | return target == bfd_plugin_vec (); | 45 | 3 | } |
Unexecuted instantiation: archive.c:bfd_plugin_target_p format.c:bfd_plugin_target_p Line | Count | Source | 43 | 17.3M | { | 44 | 17.3M | return target == bfd_plugin_vec (); | 45 | 17.3M | } |
Unexecuted instantiation: elflink.c:bfd_plugin_target_p Unexecuted instantiation: plugin.c:bfd_plugin_target_p Unexecuted instantiation: fuzz_ranlib_simulation.c:bfd_plugin_target_p Unexecuted instantiation: fuzz_objcopy.c:bfd_plugin_target_p |
46 | | #else |
47 | | static inline void |
48 | | bfd_plugin_set_program_name (const char *name ATTRIBUTE_UNUSED) |
49 | | { |
50 | | } |
51 | | |
52 | | static inline int |
53 | | bfd_plugin_open_input (bfd *ibfd ATTRIBUTE_UNUSED, |
54 | | struct ld_plugin_input_file *file ATTRIBUTE_UNUSED) |
55 | | { |
56 | | return 0; |
57 | | } |
58 | | |
59 | | static inline void |
60 | | bfd_plugin_set_plugin (const char *p ATTRIBUTE_UNUSED) |
61 | | { |
62 | | } |
63 | | |
64 | | static inline bool |
65 | | bfd_link_plugin_object_p (bfd *abfd ATTRIBUTE_UNUSED) |
66 | | { |
67 | | return false; |
68 | | } |
69 | | |
70 | | static inline void |
71 | | register_ld_plugin_object_p |
72 | | (bfd_cleanup (*object_p) (bfd *, bool) ATTRIBUTE_UNUSED) |
73 | | { |
74 | | } |
75 | | |
76 | | static inline void |
77 | | bfd_plugin_close_file_descriptor (bfd *abfd ATTRIBUTE_UNUSED, |
78 | | int fd ATTRIBUTE_UNUSED) |
79 | | { |
80 | | } |
81 | | |
82 | | static inline const bfd_target * |
83 | | bfd_plugin_vec (void) |
84 | | { |
85 | | return NULL; |
86 | | } |
87 | | |
88 | | static inline bool |
89 | | bfd_plugin_target_p (const bfd_target *target ATTRIBUTE_UNUSED) |
90 | | { |
91 | | return false; |
92 | | } |
93 | | #endif |
94 | | |
95 | | #endif |