xref: /dflybsd-src/contrib/gcc-4.7/include/plugin-api.h (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino /* plugin-api.h -- External linker plugin API.  */
2*e4b17023SJohn Marino 
3*e4b17023SJohn Marino /* Copyright 2009, 2010 Free Software Foundation, Inc.
4*e4b17023SJohn Marino    Written by Cary Coutant <ccoutant@google.com>.
5*e4b17023SJohn Marino 
6*e4b17023SJohn Marino    This file is part of binutils.
7*e4b17023SJohn Marino 
8*e4b17023SJohn Marino    This program is free software; you can redistribute it and/or modify
9*e4b17023SJohn Marino    it under the terms of the GNU General Public License as published by
10*e4b17023SJohn Marino    the Free Software Foundation; either version 3 of the License, or
11*e4b17023SJohn Marino    (at your option) any later version.
12*e4b17023SJohn Marino 
13*e4b17023SJohn Marino    This program is distributed in the hope that it will be useful,
14*e4b17023SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
15*e4b17023SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*e4b17023SJohn Marino    GNU General Public License for more details.
17*e4b17023SJohn Marino 
18*e4b17023SJohn Marino    You should have received a copy of the GNU General Public License
19*e4b17023SJohn Marino    along with this program; if not, write to the Free Software
20*e4b17023SJohn Marino    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21*e4b17023SJohn Marino    MA 02110-1301, USA.  */
22*e4b17023SJohn Marino 
23*e4b17023SJohn Marino /* This file defines the interface for writing a linker plugin, which is
24*e4b17023SJohn Marino    described at < http://gcc.gnu.org/wiki/whopr/driver >.  */
25*e4b17023SJohn Marino 
26*e4b17023SJohn Marino #ifndef PLUGIN_API_H
27*e4b17023SJohn Marino #define PLUGIN_API_H
28*e4b17023SJohn Marino 
29*e4b17023SJohn Marino #ifdef HAVE_STDINT_H
30*e4b17023SJohn Marino #include <stdint.h>
31*e4b17023SJohn Marino #elif defined(HAVE_INTTYPES_H)
32*e4b17023SJohn Marino #include <inttypes.h>
33*e4b17023SJohn Marino #endif
34*e4b17023SJohn Marino #include <sys/types.h>
35*e4b17023SJohn Marino #if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && \
36*e4b17023SJohn Marino     !defined(UINT64_MAX) && !defined(uint64_t)
37*e4b17023SJohn Marino #error can not find uint64_t type
38*e4b17023SJohn Marino #endif
39*e4b17023SJohn Marino 
40*e4b17023SJohn Marino #ifdef __cplusplus
41*e4b17023SJohn Marino extern "C"
42*e4b17023SJohn Marino {
43*e4b17023SJohn Marino #endif
44*e4b17023SJohn Marino 
45*e4b17023SJohn Marino /* Status code returned by most API routines.  */
46*e4b17023SJohn Marino 
47*e4b17023SJohn Marino enum ld_plugin_status
48*e4b17023SJohn Marino {
49*e4b17023SJohn Marino   LDPS_OK = 0,
50*e4b17023SJohn Marino   LDPS_NO_SYMS,         /* Attempt to get symbols that haven't been added. */
51*e4b17023SJohn Marino   LDPS_BAD_HANDLE,      /* No claimed object associated with given handle. */
52*e4b17023SJohn Marino   LDPS_ERR
53*e4b17023SJohn Marino   /* Additional Error codes TBD.  */
54*e4b17023SJohn Marino };
55*e4b17023SJohn Marino 
56*e4b17023SJohn Marino /* The version of the API specification.  */
57*e4b17023SJohn Marino 
58*e4b17023SJohn Marino enum ld_plugin_api_version
59*e4b17023SJohn Marino {
60*e4b17023SJohn Marino   LD_PLUGIN_API_VERSION = 1
61*e4b17023SJohn Marino };
62*e4b17023SJohn Marino 
63*e4b17023SJohn Marino /* The type of output file being generated by the linker.  */
64*e4b17023SJohn Marino 
65*e4b17023SJohn Marino enum ld_plugin_output_file_type
66*e4b17023SJohn Marino {
67*e4b17023SJohn Marino   LDPO_REL,
68*e4b17023SJohn Marino   LDPO_EXEC,
69*e4b17023SJohn Marino   LDPO_DYN
70*e4b17023SJohn Marino };
71*e4b17023SJohn Marino 
72*e4b17023SJohn Marino /* An input file managed by the plugin library.  */
73*e4b17023SJohn Marino 
74*e4b17023SJohn Marino struct ld_plugin_input_file
75*e4b17023SJohn Marino {
76*e4b17023SJohn Marino   const char *name;
77*e4b17023SJohn Marino   int fd;
78*e4b17023SJohn Marino   off_t offset;
79*e4b17023SJohn Marino   off_t filesize;
80*e4b17023SJohn Marino   void *handle;
81*e4b17023SJohn Marino };
82*e4b17023SJohn Marino 
83*e4b17023SJohn Marino /* A symbol belonging to an input file managed by the plugin library.  */
84*e4b17023SJohn Marino 
85*e4b17023SJohn Marino struct ld_plugin_symbol
86*e4b17023SJohn Marino {
87*e4b17023SJohn Marino   char *name;
88*e4b17023SJohn Marino   char *version;
89*e4b17023SJohn Marino   int def;
90*e4b17023SJohn Marino   int visibility;
91*e4b17023SJohn Marino   uint64_t size;
92*e4b17023SJohn Marino   char *comdat_key;
93*e4b17023SJohn Marino   int resolution;
94*e4b17023SJohn Marino };
95*e4b17023SJohn Marino 
96*e4b17023SJohn Marino /* An object's section.  */
97*e4b17023SJohn Marino 
98*e4b17023SJohn Marino struct ld_plugin_section
99*e4b17023SJohn Marino {
100*e4b17023SJohn Marino   const void* handle;
101*e4b17023SJohn Marino   unsigned int shndx;
102*e4b17023SJohn Marino };
103*e4b17023SJohn Marino 
104*e4b17023SJohn Marino /* Whether the symbol is a definition, reference, or common, weak or not.  */
105*e4b17023SJohn Marino 
106*e4b17023SJohn Marino enum ld_plugin_symbol_kind
107*e4b17023SJohn Marino {
108*e4b17023SJohn Marino   LDPK_DEF,
109*e4b17023SJohn Marino   LDPK_WEAKDEF,
110*e4b17023SJohn Marino   LDPK_UNDEF,
111*e4b17023SJohn Marino   LDPK_WEAKUNDEF,
112*e4b17023SJohn Marino   LDPK_COMMON
113*e4b17023SJohn Marino };
114*e4b17023SJohn Marino 
115*e4b17023SJohn Marino /* The visibility of the symbol.  */
116*e4b17023SJohn Marino 
117*e4b17023SJohn Marino enum ld_plugin_symbol_visibility
118*e4b17023SJohn Marino {
119*e4b17023SJohn Marino   LDPV_DEFAULT,
120*e4b17023SJohn Marino   LDPV_PROTECTED,
121*e4b17023SJohn Marino   LDPV_INTERNAL,
122*e4b17023SJohn Marino   LDPV_HIDDEN
123*e4b17023SJohn Marino };
124*e4b17023SJohn Marino 
125*e4b17023SJohn Marino /* How a symbol is resolved.  */
126*e4b17023SJohn Marino 
127*e4b17023SJohn Marino enum ld_plugin_symbol_resolution
128*e4b17023SJohn Marino {
129*e4b17023SJohn Marino   LDPR_UNKNOWN = 0,
130*e4b17023SJohn Marino 
131*e4b17023SJohn Marino   /* Symbol is still undefined at this point.  */
132*e4b17023SJohn Marino   LDPR_UNDEF,
133*e4b17023SJohn Marino 
134*e4b17023SJohn Marino   /* This is the prevailing definition of the symbol, with references from
135*e4b17023SJohn Marino      regular object code.  */
136*e4b17023SJohn Marino   LDPR_PREVAILING_DEF,
137*e4b17023SJohn Marino 
138*e4b17023SJohn Marino   /* This is the prevailing definition of the symbol, with no
139*e4b17023SJohn Marino      references from regular objects.  It is only referenced from IR
140*e4b17023SJohn Marino      code.  */
141*e4b17023SJohn Marino   LDPR_PREVAILING_DEF_IRONLY,
142*e4b17023SJohn Marino 
143*e4b17023SJohn Marino   /* This definition was pre-empted by a definition in a regular
144*e4b17023SJohn Marino      object file.  */
145*e4b17023SJohn Marino   LDPR_PREEMPTED_REG,
146*e4b17023SJohn Marino 
147*e4b17023SJohn Marino   /* This definition was pre-empted by a definition in another IR file.  */
148*e4b17023SJohn Marino   LDPR_PREEMPTED_IR,
149*e4b17023SJohn Marino 
150*e4b17023SJohn Marino   /* This symbol was resolved by a definition in another IR file.  */
151*e4b17023SJohn Marino   LDPR_RESOLVED_IR,
152*e4b17023SJohn Marino 
153*e4b17023SJohn Marino   /* This symbol was resolved by a definition in a regular object
154*e4b17023SJohn Marino      linked into the main executable.  */
155*e4b17023SJohn Marino   LDPR_RESOLVED_EXEC,
156*e4b17023SJohn Marino 
157*e4b17023SJohn Marino   /* This symbol was resolved by a definition in a shared object.  */
158*e4b17023SJohn Marino   LDPR_RESOLVED_DYN,
159*e4b17023SJohn Marino 
160*e4b17023SJohn Marino   /* This is the prevailing definition of the symbol, with no
161*e4b17023SJohn Marino      references from regular objects.  It is only referenced from IR
162*e4b17023SJohn Marino      code, but the symbol is exported and may be referenced from
163*e4b17023SJohn Marino      a dynamic object (not seen at link time).  */
164*e4b17023SJohn Marino   LDPR_PREVAILING_DEF_IRONLY_EXP
165*e4b17023SJohn Marino };
166*e4b17023SJohn Marino 
167*e4b17023SJohn Marino /* The plugin library's "claim file" handler.  */
168*e4b17023SJohn Marino 
169*e4b17023SJohn Marino typedef
170*e4b17023SJohn Marino enum ld_plugin_status
171*e4b17023SJohn Marino (*ld_plugin_claim_file_handler) (
172*e4b17023SJohn Marino   const struct ld_plugin_input_file *file, int *claimed);
173*e4b17023SJohn Marino 
174*e4b17023SJohn Marino /* The plugin library's "all symbols read" handler.  */
175*e4b17023SJohn Marino 
176*e4b17023SJohn Marino typedef
177*e4b17023SJohn Marino enum ld_plugin_status
178*e4b17023SJohn Marino (*ld_plugin_all_symbols_read_handler) (void);
179*e4b17023SJohn Marino 
180*e4b17023SJohn Marino /* The plugin library's cleanup handler.  */
181*e4b17023SJohn Marino 
182*e4b17023SJohn Marino typedef
183*e4b17023SJohn Marino enum ld_plugin_status
184*e4b17023SJohn Marino (*ld_plugin_cleanup_handler) (void);
185*e4b17023SJohn Marino 
186*e4b17023SJohn Marino /* The linker's interface for registering the "claim file" handler.  */
187*e4b17023SJohn Marino 
188*e4b17023SJohn Marino typedef
189*e4b17023SJohn Marino enum ld_plugin_status
190*e4b17023SJohn Marino (*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
191*e4b17023SJohn Marino 
192*e4b17023SJohn Marino /* The linker's interface for registering the "all symbols read" handler.  */
193*e4b17023SJohn Marino 
194*e4b17023SJohn Marino typedef
195*e4b17023SJohn Marino enum ld_plugin_status
196*e4b17023SJohn Marino (*ld_plugin_register_all_symbols_read) (
197*e4b17023SJohn Marino   ld_plugin_all_symbols_read_handler handler);
198*e4b17023SJohn Marino 
199*e4b17023SJohn Marino /* The linker's interface for registering the cleanup handler.  */
200*e4b17023SJohn Marino 
201*e4b17023SJohn Marino typedef
202*e4b17023SJohn Marino enum ld_plugin_status
203*e4b17023SJohn Marino (*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
204*e4b17023SJohn Marino 
205*e4b17023SJohn Marino /* The linker's interface for adding symbols from a claimed input file.  */
206*e4b17023SJohn Marino 
207*e4b17023SJohn Marino typedef
208*e4b17023SJohn Marino enum ld_plugin_status
209*e4b17023SJohn Marino (*ld_plugin_add_symbols) (void *handle, int nsyms,
210*e4b17023SJohn Marino                           const struct ld_plugin_symbol *syms);
211*e4b17023SJohn Marino 
212*e4b17023SJohn Marino /* The linker's interface for getting the input file information with
213*e4b17023SJohn Marino    an open (possibly re-opened) file descriptor.  */
214*e4b17023SJohn Marino 
215*e4b17023SJohn Marino typedef
216*e4b17023SJohn Marino enum ld_plugin_status
217*e4b17023SJohn Marino (*ld_plugin_get_input_file) (const void *handle,
218*e4b17023SJohn Marino                              struct ld_plugin_input_file *file);
219*e4b17023SJohn Marino 
220*e4b17023SJohn Marino typedef
221*e4b17023SJohn Marino enum ld_plugin_status
222*e4b17023SJohn Marino (*ld_plugin_get_view) (const void *handle, const void **viewp);
223*e4b17023SJohn Marino 
224*e4b17023SJohn Marino /* The linker's interface for releasing the input file.  */
225*e4b17023SJohn Marino 
226*e4b17023SJohn Marino typedef
227*e4b17023SJohn Marino enum ld_plugin_status
228*e4b17023SJohn Marino (*ld_plugin_release_input_file) (const void *handle);
229*e4b17023SJohn Marino 
230*e4b17023SJohn Marino /* The linker's interface for retrieving symbol resolution information.  */
231*e4b17023SJohn Marino 
232*e4b17023SJohn Marino typedef
233*e4b17023SJohn Marino enum ld_plugin_status
234*e4b17023SJohn Marino (*ld_plugin_get_symbols) (const void *handle, int nsyms,
235*e4b17023SJohn Marino                           struct ld_plugin_symbol *syms);
236*e4b17023SJohn Marino 
237*e4b17023SJohn Marino /* The linker's interface for adding a compiled input file.  */
238*e4b17023SJohn Marino 
239*e4b17023SJohn Marino typedef
240*e4b17023SJohn Marino enum ld_plugin_status
241*e4b17023SJohn Marino (*ld_plugin_add_input_file) (const char *pathname);
242*e4b17023SJohn Marino 
243*e4b17023SJohn Marino /* The linker's interface for adding a library that should be searched.  */
244*e4b17023SJohn Marino 
245*e4b17023SJohn Marino typedef
246*e4b17023SJohn Marino enum ld_plugin_status
247*e4b17023SJohn Marino (*ld_plugin_add_input_library) (const char *libname);
248*e4b17023SJohn Marino 
249*e4b17023SJohn Marino /* The linker's interface for adding a library path that should be searched.  */
250*e4b17023SJohn Marino 
251*e4b17023SJohn Marino typedef
252*e4b17023SJohn Marino enum ld_plugin_status
253*e4b17023SJohn Marino (*ld_plugin_set_extra_library_path) (const char *path);
254*e4b17023SJohn Marino 
255*e4b17023SJohn Marino /* The linker's interface for issuing a warning or error message.  */
256*e4b17023SJohn Marino 
257*e4b17023SJohn Marino typedef
258*e4b17023SJohn Marino enum ld_plugin_status
259*e4b17023SJohn Marino (*ld_plugin_message) (int level, const char *format, ...);
260*e4b17023SJohn Marino 
261*e4b17023SJohn Marino /* The linker's interface for retrieving the number of sections in an object.
262*e4b17023SJohn Marino    The handle is obtained in the claim_file handler.  This interface should
263*e4b17023SJohn Marino    only be invoked in the claim_file handler.   This function sets *COUNT to
264*e4b17023SJohn Marino    the number of sections in the object.  */
265*e4b17023SJohn Marino 
266*e4b17023SJohn Marino typedef
267*e4b17023SJohn Marino enum ld_plugin_status
268*e4b17023SJohn Marino (*ld_plugin_get_input_section_count) (const void* handle, unsigned int *count);
269*e4b17023SJohn Marino 
270*e4b17023SJohn Marino /* The linker's interface for retrieving the section type of a specific
271*e4b17023SJohn Marino    section in an object.  This interface should only be invoked in the
272*e4b17023SJohn Marino    claim_file handler.  This function sets *TYPE to an ELF SHT_xxx value.  */
273*e4b17023SJohn Marino 
274*e4b17023SJohn Marino typedef
275*e4b17023SJohn Marino enum ld_plugin_status
276*e4b17023SJohn Marino (*ld_plugin_get_input_section_type) (const struct ld_plugin_section section,
277*e4b17023SJohn Marino                                      unsigned int *type);
278*e4b17023SJohn Marino 
279*e4b17023SJohn Marino /* The linker's interface for retrieving the name of a specific section in
280*e4b17023SJohn Marino    an object. This interface should only be invoked in the claim_file handler.
281*e4b17023SJohn Marino    This function sets *SECTION_NAME_PTR to a null-terminated buffer allocated
282*e4b17023SJohn Marino    by malloc.  The plugin must free *SECTION_NAME_PTR.  */
283*e4b17023SJohn Marino 
284*e4b17023SJohn Marino typedef
285*e4b17023SJohn Marino enum ld_plugin_status
286*e4b17023SJohn Marino (*ld_plugin_get_input_section_name) (const struct ld_plugin_section section,
287*e4b17023SJohn Marino                                      char **section_name_ptr);
288*e4b17023SJohn Marino 
289*e4b17023SJohn Marino /* The linker's interface for retrieving the contents of a specific section
290*e4b17023SJohn Marino    in an object.  This interface should only be invoked in the claim_file
291*e4b17023SJohn Marino    handler.  This function sets *SECTION_CONTENTS to point to a buffer that is
292*e4b17023SJohn Marino    valid until clam_file handler returns.  It sets *LEN to the size of the
293*e4b17023SJohn Marino    buffer.  */
294*e4b17023SJohn Marino 
295*e4b17023SJohn Marino typedef
296*e4b17023SJohn Marino enum ld_plugin_status
297*e4b17023SJohn Marino (*ld_plugin_get_input_section_contents) (const struct ld_plugin_section section,
298*e4b17023SJohn Marino                                          const unsigned char **section_contents,
299*e4b17023SJohn Marino                                          size_t* len);
300*e4b17023SJohn Marino 
301*e4b17023SJohn Marino /* The linker's interface for specifying the desired order of sections.
302*e4b17023SJohn Marino    The sections should be specifed using the array SECTION_LIST in the
303*e4b17023SJohn Marino    order in which they should appear in the final layout.  NUM_SECTIONS
304*e4b17023SJohn Marino    specifies the number of entries in each array.  This should be invoked
305*e4b17023SJohn Marino    in the all_symbols_read handler.  */
306*e4b17023SJohn Marino 
307*e4b17023SJohn Marino typedef
308*e4b17023SJohn Marino enum ld_plugin_status
309*e4b17023SJohn Marino (*ld_plugin_update_section_order) (const struct ld_plugin_section *section_list,
310*e4b17023SJohn Marino 				   unsigned int num_sections);
311*e4b17023SJohn Marino 
312*e4b17023SJohn Marino /* The linker's interface for specifying that reordering of sections is
313*e4b17023SJohn Marino    desired so that the linker can prepare for it.  This should be invoked
314*e4b17023SJohn Marino    before update_section_order, preferably in the claim_file handler.  */
315*e4b17023SJohn Marino 
316*e4b17023SJohn Marino typedef
317*e4b17023SJohn Marino enum ld_plugin_status
318*e4b17023SJohn Marino (*ld_plugin_allow_section_ordering) (void);
319*e4b17023SJohn Marino 
320*e4b17023SJohn Marino enum ld_plugin_level
321*e4b17023SJohn Marino {
322*e4b17023SJohn Marino   LDPL_INFO,
323*e4b17023SJohn Marino   LDPL_WARNING,
324*e4b17023SJohn Marino   LDPL_ERROR,
325*e4b17023SJohn Marino   LDPL_FATAL
326*e4b17023SJohn Marino };
327*e4b17023SJohn Marino 
328*e4b17023SJohn Marino /* Values for the tv_tag field of the transfer vector.  */
329*e4b17023SJohn Marino 
330*e4b17023SJohn Marino enum ld_plugin_tag
331*e4b17023SJohn Marino {
332*e4b17023SJohn Marino   LDPT_NULL = 0,
333*e4b17023SJohn Marino   LDPT_API_VERSION,
334*e4b17023SJohn Marino   LDPT_GOLD_VERSION,
335*e4b17023SJohn Marino   LDPT_LINKER_OUTPUT,
336*e4b17023SJohn Marino   LDPT_OPTION,
337*e4b17023SJohn Marino   LDPT_REGISTER_CLAIM_FILE_HOOK,
338*e4b17023SJohn Marino   LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK,
339*e4b17023SJohn Marino   LDPT_REGISTER_CLEANUP_HOOK,
340*e4b17023SJohn Marino   LDPT_ADD_SYMBOLS,
341*e4b17023SJohn Marino   LDPT_GET_SYMBOLS,
342*e4b17023SJohn Marino   LDPT_ADD_INPUT_FILE,
343*e4b17023SJohn Marino   LDPT_MESSAGE,
344*e4b17023SJohn Marino   LDPT_GET_INPUT_FILE,
345*e4b17023SJohn Marino   LDPT_RELEASE_INPUT_FILE,
346*e4b17023SJohn Marino   LDPT_ADD_INPUT_LIBRARY,
347*e4b17023SJohn Marino   LDPT_OUTPUT_NAME,
348*e4b17023SJohn Marino   LDPT_SET_EXTRA_LIBRARY_PATH,
349*e4b17023SJohn Marino   LDPT_GNU_LD_VERSION,
350*e4b17023SJohn Marino   LDPT_GET_VIEW,
351*e4b17023SJohn Marino   LDPT_GET_INPUT_SECTION_COUNT,
352*e4b17023SJohn Marino   LDPT_GET_INPUT_SECTION_TYPE,
353*e4b17023SJohn Marino   LDPT_GET_INPUT_SECTION_NAME,
354*e4b17023SJohn Marino   LDPT_GET_INPUT_SECTION_CONTENTS,
355*e4b17023SJohn Marino   LDPT_UPDATE_SECTION_ORDER,
356*e4b17023SJohn Marino   LDPT_ALLOW_SECTION_ORDERING,
357*e4b17023SJohn Marino   LDPT_GET_SYMBOLS_V2
358*e4b17023SJohn Marino };
359*e4b17023SJohn Marino 
360*e4b17023SJohn Marino /* The plugin transfer vector.  */
361*e4b17023SJohn Marino 
362*e4b17023SJohn Marino struct ld_plugin_tv
363*e4b17023SJohn Marino {
364*e4b17023SJohn Marino   enum ld_plugin_tag tv_tag;
365*e4b17023SJohn Marino   union
366*e4b17023SJohn Marino   {
367*e4b17023SJohn Marino     int tv_val;
368*e4b17023SJohn Marino     const char *tv_string;
369*e4b17023SJohn Marino     ld_plugin_register_claim_file tv_register_claim_file;
370*e4b17023SJohn Marino     ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
371*e4b17023SJohn Marino     ld_plugin_register_cleanup tv_register_cleanup;
372*e4b17023SJohn Marino     ld_plugin_add_symbols tv_add_symbols;
373*e4b17023SJohn Marino     ld_plugin_get_symbols tv_get_symbols;
374*e4b17023SJohn Marino     ld_plugin_add_input_file tv_add_input_file;
375*e4b17023SJohn Marino     ld_plugin_message tv_message;
376*e4b17023SJohn Marino     ld_plugin_get_input_file tv_get_input_file;
377*e4b17023SJohn Marino     ld_plugin_get_view tv_get_view;
378*e4b17023SJohn Marino     ld_plugin_release_input_file tv_release_input_file;
379*e4b17023SJohn Marino     ld_plugin_add_input_library tv_add_input_library;
380*e4b17023SJohn Marino     ld_plugin_set_extra_library_path tv_set_extra_library_path;
381*e4b17023SJohn Marino     ld_plugin_get_input_section_count tv_get_input_section_count;
382*e4b17023SJohn Marino     ld_plugin_get_input_section_type tv_get_input_section_type;
383*e4b17023SJohn Marino     ld_plugin_get_input_section_name tv_get_input_section_name;
384*e4b17023SJohn Marino     ld_plugin_get_input_section_contents tv_get_input_section_contents;
385*e4b17023SJohn Marino     ld_plugin_update_section_order tv_update_section_order;
386*e4b17023SJohn Marino     ld_plugin_allow_section_ordering tv_allow_section_ordering;
387*e4b17023SJohn Marino   } tv_u;
388*e4b17023SJohn Marino };
389*e4b17023SJohn Marino 
390*e4b17023SJohn Marino /* The plugin library's "onload" entry point.  */
391*e4b17023SJohn Marino 
392*e4b17023SJohn Marino typedef
393*e4b17023SJohn Marino enum ld_plugin_status
394*e4b17023SJohn Marino (*ld_plugin_onload) (struct ld_plugin_tv *tv);
395*e4b17023SJohn Marino 
396*e4b17023SJohn Marino #ifdef __cplusplus
397*e4b17023SJohn Marino }
398*e4b17023SJohn Marino #endif
399*e4b17023SJohn Marino 
400*e4b17023SJohn Marino #endif /* !defined(PLUGIN_API_H) */
401