source: trunk/src/binutils/ld/ldemul.h@ 947

Last change on this file since 947 was 618, checked in by bird, 22 years ago

Joined the port of 2.11.2 with 2.14.

  • Property cvs2svn:cvs-rev set to 1.4
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 6.9 KB
RevLine 
[10]1/* ld-emul.h - Linker emulation header file
[618]2 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
[10]3 Free Software Foundation, Inc.
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
[618]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
[10]53 PARAMS ((struct lang_input_statement_struct *, asection *));
[618]54extern bfd_boolean ldemul_parse_args
55 PARAMS ((int, char **));
56extern void ldemul_add_options
57 PARAMS ((int, char **, int, struct option **, int, struct option **));
58extern bfd_boolean ldemul_handle_option
59 PARAMS ((int));
60extern bfd_boolean ldemul_unrecognized_file
[10]61 PARAMS ((struct lang_input_statement_struct *));
[618]62extern bfd_boolean ldemul_recognized_file
[10]63 PARAMS ((struct lang_input_statement_struct *));
[618]64extern bfd_boolean ldemul_open_dynamic_archive
[10]65 PARAMS ((const char *, struct search_dirs *,
66 struct lang_input_statement_struct *));
[618]67extern char *ldemul_default_target
68 PARAMS ((int, char**));
69extern void after_parse_default
70 PARAMS ((void));
71extern void after_open_default
72 PARAMS ((void));
73extern void after_allocation_default
74 PARAMS ((void));
75extern void before_allocation_default
76 PARAMS ((void));
77extern void set_output_arch_default
78 PARAMS ((void));
79extern void syslib_default
80 PARAMS ((char*));
81extern void hll_default
82 PARAMS ((char*));
[10]83extern int ldemul_find_potential_libraries
84 PARAMS ((char *, struct lang_input_statement_struct *));
[618]85extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
86 PARAMS ((struct bfd_elf_version_expr *));
[10]87
88typedef struct ld_emulation_xfer_struct {
89 /* Run before parsing the command line and script file.
90 Set the architecture, maybe other things. */
91 void (*before_parse) PARAMS ((void));
92
93 /* Handle the SYSLIB (low level library) script command. */
94 void (*syslib) PARAMS ((char *));
95
96 /* Handle the HLL (high level library) script command. */
97 void (*hll) PARAMS ((char *));
98
99 /* Run after parsing the command line and script file. */
100 void (*after_parse) PARAMS ((void));
101
102 /* Run after opening all input files, and loading the symbols. */
103 void (*after_open) PARAMS ((void));
104
105 /* Run after allocating output sections. */
106 void (*after_allocation) PARAMS ( (void));
107
108 /* Set the output architecture and machine if possible. */
109 void (*set_output_arch) PARAMS ((void));
110
111 /* Decide which target name to use. */
[618]112 char * (*choose_target) PARAMS ((int, char**));
[10]113
114 /* Run before allocating output sections. */
115 void (*before_allocation) PARAMS ((void));
116
117 /* Return the appropriate linker script. */
118 char * (*get_script) PARAMS ((int *isfile));
119
120 /* The name of this emulation. */
121 char *emulation_name;
122
123 /* The output format. */
124 char *target_name;
125
126 /* Run after assigning values from the script. */
127 void (*finish) PARAMS ((void));
128
129 /* Create any output sections needed by the target. */
130 void (*create_output_section_statements) PARAMS ((void));
131
132 /* Try to open a dynamic library. ARCH is an architecture name, and
133 is normally the empty string. ENTRY is the lang_input_statement
134 that should be opened. */
[618]135 bfd_boolean (*open_dynamic_archive)
[10]136 PARAMS ((const char *arch, struct search_dirs *,
137 struct lang_input_statement_struct *entry));
138
[618]139 /* Place an orphan section. Return TRUE if it was placed, FALSE if
[10]140 the default action should be taken. This field may be NULL, in
141 which case the default action will always be taken. */
[618]142 bfd_boolean (*place_orphan)
[10]143 PARAMS ((struct lang_input_statement_struct *, asection *));
144
145 /* Run after assigning parsing with the args, but before
146 reading the script. Used to initialize symbols used in the script. */
147 void (*set_symbols) PARAMS ((void));
148
[618]149 /* Parse args which the base linker doesn't understand.
150 Return TRUE if the arg needs no further processing. */
151 bfd_boolean (*parse_args) PARAMS ((int, char **));
[10]152
[618]153 /* Hook to add options to parameters passed by the base linker to
154 getopt_long and getopt_long_only calls. */
155 void (*add_options)
156 PARAMS ((int, char **, int, struct option **, int, struct option **));
157
158 /* Companion to the above to handle an option. Returns TRUE if it is
159 one of our options. */
160 bfd_boolean (*handle_option) PARAMS ((int));
161
[10]162 /* Run to handle files which are not recognized as object files or
[618]163 archives. Return TRUE if the file was handled. */
164 bfd_boolean (*unrecognized_file)
[10]165 PARAMS ((struct lang_input_statement_struct *));
166
167 /* Run to list the command line options which parse_args handles. */
168 void (* list_options) PARAMS ((FILE *));
169
170 /* Run to specially handle files which *are* recognized as object
[618]171 files or archives. Return TRUE if the file was handled. */
172 bfd_boolean (*recognized_file)
[10]173 PARAMS ((struct lang_input_statement_struct *));
174
175 /* Called when looking for libraries in a directory specified
176 via a linker command line option or linker script option.
177 Files that match the pattern "lib*.a" have already been scanned.
178 (For VMS files matching ":lib*.a" have also been scanned). */
179 int (* find_potential_libraries)
180 PARAMS ((char *, struct lang_input_statement_struct *));
181
[618]182 /* Called when adding a new version pattern. PowerPC64-ELF uses
183 this hook to add a pattern matching ".foo" for every "foo". */
184 struct bfd_elf_version_expr * (*new_vers_pattern)
185 PARAMS ((struct bfd_elf_version_expr *));
186
[100]187 /* Perform final action(s) on output file
188 Note: Added by the EMX/OS2 port, so keep it at the end! */
[86]189 void (*finish_link) PARAMS ((char *));
190
[10]191} ld_emulation_xfer_type;
192
193typedef enum {
194 intel_ic960_ld_mode_enum,
195 default_mode_enum,
196 intel_gld960_ld_mode_enum
197} lang_emulation_mode_enum_type;
198
199extern ld_emulation_xfer_type *ld_emulations[];
200
201#endif
Note: See TracBrowser for help on using the repository browser.