1 /* ld-emul.h - Linker emulation header file
2 Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
4 This file is part of GLD, the Gnu Linker.
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)
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. */
20 struct lang_input_statement_struct
;
24 extern void ldemul_hll
PARAMS ((char *));
25 extern void ldemul_syslib
PARAMS ((char *));
26 extern void ldemul_after_parse
PARAMS ((void));
27 extern void ldemul_before_parse
PARAMS ((void));
28 extern void ldemul_after_open
PARAMS ((void));
29 extern void ldemul_after_allocation
PARAMS ((void));
30 extern void ldemul_before_allocation
PARAMS ((void));
31 extern void ldemul_set_output_arch
PARAMS ((void));
32 extern char *ldemul_choose_target
PARAMS ((void));
33 extern void ldemul_choose_mode
PARAMS ((char *));
34 extern void ldemul_list_emulations
PARAMS ((FILE *));
35 extern void ldemul_list_emulation_options
PARAMS ((FILE *));
36 extern char *ldemul_get_script
PARAMS ((int *isfile
));
37 extern void ldemul_finish
PARAMS ((void));
38 extern void ldemul_set_symbols
PARAMS ((void));
39 extern void ldemul_create_output_section_statements
PARAMS ((void));
40 extern boolean ldemul_place_orphan
41 PARAMS ((struct lang_input_statement_struct
*, asection
*));
42 extern int ldemul_parse_args
PARAMS ((int, char **));
43 extern boolean ldemul_unrecognized_file
44 PARAMS ((struct lang_input_statement_struct
*));
45 extern boolean ldemul_recognized_file
46 PARAMS ((struct lang_input_statement_struct
*));
47 extern boolean ldemul_open_dynamic_archive
48 PARAMS ((const char *, struct search_dirs
*,
49 struct lang_input_statement_struct
*));
50 extern char *ldemul_default_target
PARAMS ((void));
51 extern void after_parse_default
PARAMS ((void));
52 extern void after_open_default
PARAMS ((void));
53 extern void after_allocation_default
PARAMS ((void));
54 extern void before_allocation_default
PARAMS ((void));
55 extern void set_output_arch_default
PARAMS ((void));
56 extern void syslib_default
PARAMS ((char*));
57 extern void hll_default
PARAMS ((char*));
59 typedef struct ld_emulation_xfer_struct
61 /* Run before parsing the command line and script file.
62 Set the architecture, maybe other things. */
63 void (*before_parse
) PARAMS ((void));
65 /* Handle the SYSLIB (low level library) script command. */
66 void (*syslib
) PARAMS ((char *));
68 /* Handle the HLL (high level library) script command. */
69 void (*hll
) PARAMS ((char *));
71 /* Run after parsing the command line and script file. */
72 void (*after_parse
) PARAMS ((void));
74 /* Run after opening all input files, and loading the symbols. */
75 void (*after_open
) PARAMS ((void));
77 /* Run after allocating output sections. */
78 void (*after_allocation
) PARAMS ( (void));
80 /* Set the output architecture and machine if possible. */
81 void (*set_output_arch
) PARAMS ((void));
83 /* Decide which target name to use. */
84 char * (*choose_target
) PARAMS ((void));
86 /* Run before allocating output sections. */
87 void (*before_allocation
) PARAMS ((void));
89 /* Return the appropriate linker script. */
90 char * (*get_script
) PARAMS ((int *isfile
));
92 /* The name of this emulation. */
95 /* The output format. */
98 /* Run after assigning values from the script. */
99 void (*finish
) PARAMS ((void));
101 /* Create any output sections needed by the target. */
102 void (*create_output_section_statements
) PARAMS ((void));
104 /* Try to open a dynamic library. ARCH is an architecture name, and
105 is normally the empty string. ENTRY is the lang_input_statement
106 that should be opened. */
107 boolean (*open_dynamic_archive
)
108 PARAMS ((const char *arch
, struct search_dirs
*,
109 struct lang_input_statement_struct
*entry
));
111 /* Place an orphan section. Return true if it was placed, false if
112 the default action should be taken. This field may be NULL, in
113 which case the default action will always be taken. */
114 boolean (*place_orphan
)
115 PARAMS ((struct lang_input_statement_struct
*, asection
*));
117 /* Run after assigning parsing with the args, but before
118 reading the script. Used to initialize symbols used in the script. */
119 void (*set_symbols
) PARAMS ((void));
121 /* Run to parse args which the base linker doesn't
122 understand. Return non zero on sucess. */
123 int (*parse_args
) PARAMS ((int, char **));
125 /* Run to handle files which are not recognized as object files or
126 archives. Return true if the file was handled. */
127 boolean (*unrecognized_file
)
128 PARAMS ((struct lang_input_statement_struct
*));
130 /* Run to list the command line options which parse_args handles. */
131 void (* list_options
) PARAMS ((FILE *));
133 /* Run to specially handle files which *are* recognized as object
134 files or archives. Return true if the file was handled. */
135 boolean (*recognized_file
)
136 PARAMS ((struct lang_input_statement_struct
*));
138 } ld_emulation_xfer_type
;
142 intel_ic960_ld_mode_enum
,
144 intel_gld960_ld_mode_enum
145 } lang_emulation_mode_enum_type
;
147 extern ld_emulation_xfer_type
*ld_emulations
[];