]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/ldemul.h
Remove some forward declarations in ldemul.h and ldfile.h, and
[thirdparty/binutils-gdb.git] / ld / ldemul.h
CommitLineData
252b5132 1/* ld-emul.h - Linker emulation header file
344a211f 2 Copyright 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc.
252b5132
RH
3
4 This file is part of GLD, the Gnu Linker.
5
6 GLD 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 1, or (at your option)
9 any later version.
10
11 GLD 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#ifndef LDEMUL_H
17#define LDEMUL_H
18
252b5132
RH
19extern void ldemul_hll PARAMS ((char *));
20extern void ldemul_syslib PARAMS ((char *));
21extern void ldemul_after_parse PARAMS ((void));
22extern void ldemul_before_parse PARAMS ((void));
23extern void ldemul_after_open PARAMS ((void));
24extern void ldemul_after_allocation PARAMS ((void));
25extern void ldemul_before_allocation PARAMS ((void));
26extern void ldemul_set_output_arch PARAMS ((void));
27extern char *ldemul_choose_target PARAMS ((void));
28extern void ldemul_choose_mode PARAMS ((char *));
29extern void ldemul_list_emulations PARAMS ((FILE *));
30extern void ldemul_list_emulation_options PARAMS ((FILE *));
31extern char *ldemul_get_script PARAMS ((int *isfile));
32extern void ldemul_finish PARAMS ((void));
33extern void ldemul_set_symbols PARAMS ((void));
34extern void ldemul_create_output_section_statements PARAMS ((void));
35extern boolean ldemul_place_orphan
36 PARAMS ((struct lang_input_statement_struct *, asection *));
37extern int ldemul_parse_args PARAMS ((int, char **));
38extern boolean ldemul_unrecognized_file
39 PARAMS ((struct lang_input_statement_struct *));
40extern boolean ldemul_recognized_file
41 PARAMS ((struct lang_input_statement_struct *));
42extern boolean ldemul_open_dynamic_archive
43 PARAMS ((const char *, struct search_dirs *,
44 struct lang_input_statement_struct *));
45extern char *ldemul_default_target PARAMS ((void));
46extern void after_parse_default PARAMS ((void));
47extern void after_open_default PARAMS ((void));
48extern void after_allocation_default PARAMS ((void));
49extern void before_allocation_default PARAMS ((void));
50extern void set_output_arch_default PARAMS ((void));
51extern void syslib_default PARAMS ((char*));
52extern void hll_default PARAMS ((char*));
344a211f
NC
53extern int ldemul_find_potential_libraries
54 PARAMS ((char *, struct lang_input_statement_struct *));
252b5132
RH
55
56typedef struct ld_emulation_xfer_struct
57{
58 /* Run before parsing the command line and script file.
59 Set the architecture, maybe other things. */
60 void (*before_parse) PARAMS ((void));
61
62 /* Handle the SYSLIB (low level library) script command. */
63 void (*syslib) PARAMS ((char *));
64
65 /* Handle the HLL (high level library) script command. */
66 void (*hll) PARAMS ((char *));
67
68 /* Run after parsing the command line and script file. */
69 void (*after_parse) PARAMS ((void));
70
71 /* Run after opening all input files, and loading the symbols. */
72 void (*after_open) PARAMS ((void));
73
74 /* Run after allocating output sections. */
75 void (*after_allocation) PARAMS ( (void));
76
77 /* Set the output architecture and machine if possible. */
78 void (*set_output_arch) PARAMS ((void));
79
80 /* Decide which target name to use. */
81 char * (*choose_target) PARAMS ((void));
82
83 /* Run before allocating output sections. */
84 void (*before_allocation) PARAMS ((void));
85
86 /* Return the appropriate linker script. */
87 char * (*get_script) PARAMS ((int *isfile));
88
89 /* The name of this emulation. */
90 char *emulation_name;
91
92 /* The output format. */
93 char *target_name;
94
95 /* Run after assigning values from the script. */
96 void (*finish) PARAMS ((void));
97
98 /* Create any output sections needed by the target. */
99 void (*create_output_section_statements) PARAMS ((void));
100
101 /* Try to open a dynamic library. ARCH is an architecture name, and
102 is normally the empty string. ENTRY is the lang_input_statement
103 that should be opened. */
104 boolean (*open_dynamic_archive)
105 PARAMS ((const char *arch, struct search_dirs *,
106 struct lang_input_statement_struct *entry));
107
108 /* Place an orphan section. Return true if it was placed, false if
109 the default action should be taken. This field may be NULL, in
110 which case the default action will always be taken. */
111 boolean (*place_orphan)
112 PARAMS ((struct lang_input_statement_struct *, asection *));
113
114 /* Run after assigning parsing with the args, but before
115 reading the script. Used to initialize symbols used in the script. */
116 void (*set_symbols) PARAMS ((void));
117
118 /* Run to parse args which the base linker doesn't
119 understand. Return non zero on sucess. */
120 int (*parse_args) PARAMS ((int, char **));
121
122 /* Run to handle files which are not recognized as object files or
123 archives. Return true if the file was handled. */
124 boolean (*unrecognized_file)
125 PARAMS ((struct lang_input_statement_struct *));
126
127 /* Run to list the command line options which parse_args handles. */
128 void (* list_options) PARAMS ((FILE *));
129
130 /* Run to specially handle files which *are* recognized as object
131 files or archives. Return true if the file was handled. */
132 boolean (*recognized_file)
133 PARAMS ((struct lang_input_statement_struct *));
134
344a211f
NC
135 /* Called when looking for libraries in a directory specified
136 via a linker command line option or linker script option.
137 Files that match the pattern "lib*.a" have already been scanned.
138 (For VMS files matching ":lib*.a" have also been scanned). */
139 int (* find_potential_libraries)
140 PARAMS ((char *, struct lang_input_statement_struct *));
141
252b5132
RH
142} ld_emulation_xfer_type;
143
144typedef enum
145{
146 intel_ic960_ld_mode_enum,
147 default_mode_enum ,
148 intel_gld960_ld_mode_enum
149} lang_emulation_mode_enum_type;
150
151extern ld_emulation_xfer_type *ld_emulations[];
152
153#endif