2003-01-09 Chris Demetriou <cgd@broadcom.com>
[deliverable/binutils-gdb.git] / ld / ldemul.h
CommitLineData
252b5132 1/* ld-emul.h - Linker emulation header file
b34976b6 2 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
5cc18311 3 Free Software Foundation, Inc.
252b5132
RH
4
5 This file is part of GLD, the Gnu Linker.
6
7 GLD is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 1, or (at your option)
10 any later version.
11
12 GLD is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. */
16
17#ifndef LDEMUL_H
18#define LDEMUL_H
19
b34976b6
AM
20extern void ldemul_hll
21 PARAMS ((char *));
22extern void ldemul_syslib
23 PARAMS ((char *));
24extern void ldemul_after_parse
25 PARAMS ((void));
26extern void ldemul_before_parse
27 PARAMS ((void));
28extern void ldemul_after_open
29 PARAMS ((void));
30extern void ldemul_after_allocation
31 PARAMS ((void));
32extern void ldemul_before_allocation
33 PARAMS ((void));
34extern void ldemul_set_output_arch
35 PARAMS ((void));
36extern char *ldemul_choose_target
37 PARAMS ((int, char**));
38extern void ldemul_choose_mode
39 PARAMS ((char *));
40extern void ldemul_list_emulations
41 PARAMS ((FILE *));
42extern void ldemul_list_emulation_options
43 PARAMS ((FILE *));
44extern char *ldemul_get_script
45 PARAMS ((int *isfile));
46extern void ldemul_finish
47 PARAMS ((void));
48extern void ldemul_set_symbols
49 PARAMS ((void));
50extern void ldemul_create_output_section_statements
51 PARAMS ((void));
52extern bfd_boolean ldemul_place_orphan
252b5132 53 PARAMS ((struct lang_input_statement_struct *, asection *));
b34976b6
AM
54extern int ldemul_parse_args
55 PARAMS ((int, char **));
56extern bfd_boolean ldemul_unrecognized_file
252b5132 57 PARAMS ((struct lang_input_statement_struct *));
b34976b6 58extern bfd_boolean ldemul_recognized_file
252b5132 59 PARAMS ((struct lang_input_statement_struct *));
b34976b6 60extern bfd_boolean ldemul_open_dynamic_archive
252b5132
RH
61 PARAMS ((const char *, struct search_dirs *,
62 struct lang_input_statement_struct *));
b34976b6
AM
63extern char *ldemul_default_target
64 PARAMS ((int, char**));
65extern void after_parse_default
66 PARAMS ((void));
67extern void after_open_default
68 PARAMS ((void));
69extern void after_allocation_default
70 PARAMS ((void));
71extern void before_allocation_default
72 PARAMS ((void));
73extern void set_output_arch_default
74 PARAMS ((void));
75extern void syslib_default
76 PARAMS ((char*));
77extern void hll_default
78 PARAMS ((char*));
344a211f
NC
79extern int ldemul_find_potential_libraries
80 PARAMS ((char *, struct lang_input_statement_struct *));
fac1652d
AM
81extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
82 PARAMS ((struct bfd_elf_version_expr *));
252b5132 83
89cdebba 84typedef struct ld_emulation_xfer_struct {
252b5132
RH
85 /* Run before parsing the command line and script file.
86 Set the architecture, maybe other things. */
87 void (*before_parse) PARAMS ((void));
88
89 /* Handle the SYSLIB (low level library) script command. */
90 void (*syslib) PARAMS ((char *));
91
92 /* Handle the HLL (high level library) script command. */
93 void (*hll) PARAMS ((char *));
94
95 /* Run after parsing the command line and script file. */
96 void (*after_parse) PARAMS ((void));
97
98 /* Run after opening all input files, and loading the symbols. */
99 void (*after_open) PARAMS ((void));
100
101 /* Run after allocating output sections. */
102 void (*after_allocation) PARAMS ( (void));
103
104 /* Set the output architecture and machine if possible. */
105 void (*set_output_arch) PARAMS ((void));
106
107 /* Decide which target name to use. */
742aeb63 108 char * (*choose_target) PARAMS ((int, char**));
252b5132
RH
109
110 /* Run before allocating output sections. */
111 void (*before_allocation) PARAMS ((void));
112
113 /* Return the appropriate linker script. */
114 char * (*get_script) PARAMS ((int *isfile));
115
116 /* The name of this emulation. */
117 char *emulation_name;
118
119 /* The output format. */
120 char *target_name;
121
122 /* Run after assigning values from the script. */
123 void (*finish) PARAMS ((void));
124
125 /* Create any output sections needed by the target. */
126 void (*create_output_section_statements) PARAMS ((void));
127
128 /* Try to open a dynamic library. ARCH is an architecture name, and
129 is normally the empty string. ENTRY is the lang_input_statement
130 that should be opened. */
b34976b6 131 bfd_boolean (*open_dynamic_archive)
252b5132
RH
132 PARAMS ((const char *arch, struct search_dirs *,
133 struct lang_input_statement_struct *entry));
134
b34976b6 135 /* Place an orphan section. Return TRUE if it was placed, FALSE if
252b5132
RH
136 the default action should be taken. This field may be NULL, in
137 which case the default action will always be taken. */
b34976b6 138 bfd_boolean (*place_orphan)
252b5132
RH
139 PARAMS ((struct lang_input_statement_struct *, asection *));
140
5cc18311
KH
141 /* Run after assigning parsing with the args, but before
142 reading the script. Used to initialize symbols used in the script. */
252b5132
RH
143 void (*set_symbols) PARAMS ((void));
144
145 /* Run to parse args which the base linker doesn't
5cc18311 146 understand. Return non zero on sucess. */
252b5132
RH
147 int (*parse_args) PARAMS ((int, char **));
148
149 /* Run to handle files which are not recognized as object files or
b34976b6
AM
150 archives. Return TRUE if the file was handled. */
151 bfd_boolean (*unrecognized_file)
252b5132
RH
152 PARAMS ((struct lang_input_statement_struct *));
153
154 /* Run to list the command line options which parse_args handles. */
155 void (* list_options) PARAMS ((FILE *));
156
157 /* Run to specially handle files which *are* recognized as object
b34976b6
AM
158 files or archives. Return TRUE if the file was handled. */
159 bfd_boolean (*recognized_file)
252b5132
RH
160 PARAMS ((struct lang_input_statement_struct *));
161
344a211f
NC
162 /* Called when looking for libraries in a directory specified
163 via a linker command line option or linker script option.
164 Files that match the pattern "lib*.a" have already been scanned.
165 (For VMS files matching ":lib*.a" have also been scanned). */
166 int (* find_potential_libraries)
167 PARAMS ((char *, struct lang_input_statement_struct *));
5cc18311 168
fac1652d
AM
169 /* Called when adding a new version pattern. PowerPC64-ELF uses
170 this hook to add a pattern matching ".foo" for every "foo". */
171 struct bfd_elf_version_expr * (*new_vers_pattern)
172 PARAMS ((struct bfd_elf_version_expr *));
173
252b5132
RH
174} ld_emulation_xfer_type;
175
89cdebba 176typedef enum {
252b5132 177 intel_ic960_ld_mode_enum,
89cdebba 178 default_mode_enum,
252b5132
RH
179 intel_gld960_ld_mode_enum
180} lang_emulation_mode_enum_type;
181
182extern ld_emulation_xfer_type *ld_emulations[];
183
184#endif
This page took 0.147625 seconds and 4 git commands to generate.