2000-02-23 Andrew Haley <aph@cygnus.com>
[deliverable/binutils-gdb.git] / ld / ldemul.h
CommitLineData
252b5132
RH
1/* ld-emul.h - Linker emulation header file
2 Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
19#if ANSI_PROTOTYPES
20struct lang_input_statement_struct;
21struct search_dirs;
22#endif
23
24extern void ldemul_hll PARAMS ((char *));
25extern void ldemul_syslib PARAMS ((char *));
26extern void ldemul_after_parse PARAMS ((void));
27extern void ldemul_before_parse PARAMS ((void));
28extern void ldemul_after_open PARAMS ((void));
29extern void ldemul_after_allocation PARAMS ((void));
30extern void ldemul_before_allocation PARAMS ((void));
31extern void ldemul_set_output_arch PARAMS ((void));
32extern char *ldemul_choose_target PARAMS ((void));
33extern void ldemul_choose_mode PARAMS ((char *));
34extern void ldemul_list_emulations PARAMS ((FILE *));
35extern void ldemul_list_emulation_options PARAMS ((FILE *));
36extern char *ldemul_get_script PARAMS ((int *isfile));
37extern void ldemul_finish PARAMS ((void));
38extern void ldemul_set_symbols PARAMS ((void));
39extern void ldemul_create_output_section_statements PARAMS ((void));
40extern boolean ldemul_place_orphan
41 PARAMS ((struct lang_input_statement_struct *, asection *));
42extern int ldemul_parse_args PARAMS ((int, char **));
43extern boolean ldemul_unrecognized_file
44 PARAMS ((struct lang_input_statement_struct *));
45extern boolean ldemul_recognized_file
46 PARAMS ((struct lang_input_statement_struct *));
47extern boolean ldemul_open_dynamic_archive
48 PARAMS ((const char *, struct search_dirs *,
49 struct lang_input_statement_struct *));
50extern char *ldemul_default_target PARAMS ((void));
51extern void after_parse_default PARAMS ((void));
52extern void after_open_default PARAMS ((void));
53extern void after_allocation_default PARAMS ((void));
54extern void before_allocation_default PARAMS ((void));
55extern void set_output_arch_default PARAMS ((void));
56extern void syslib_default PARAMS ((char*));
57extern void hll_default PARAMS ((char*));
58
59typedef struct ld_emulation_xfer_struct
60{
61 /* Run before parsing the command line and script file.
62 Set the architecture, maybe other things. */
63 void (*before_parse) PARAMS ((void));
64
65 /* Handle the SYSLIB (low level library) script command. */
66 void (*syslib) PARAMS ((char *));
67
68 /* Handle the HLL (high level library) script command. */
69 void (*hll) PARAMS ((char *));
70
71 /* Run after parsing the command line and script file. */
72 void (*after_parse) PARAMS ((void));
73
74 /* Run after opening all input files, and loading the symbols. */
75 void (*after_open) PARAMS ((void));
76
77 /* Run after allocating output sections. */
78 void (*after_allocation) PARAMS ( (void));
79
80 /* Set the output architecture and machine if possible. */
81 void (*set_output_arch) PARAMS ((void));
82
83 /* Decide which target name to use. */
84 char * (*choose_target) PARAMS ((void));
85
86 /* Run before allocating output sections. */
87 void (*before_allocation) PARAMS ((void));
88
89 /* Return the appropriate linker script. */
90 char * (*get_script) PARAMS ((int *isfile));
91
92 /* The name of this emulation. */
93 char *emulation_name;
94
95 /* The output format. */
96 char *target_name;
97
98 /* Run after assigning values from the script. */
99 void (*finish) PARAMS ((void));
100
101 /* Create any output sections needed by the target. */
102 void (*create_output_section_statements) PARAMS ((void));
103
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));
110
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 *));
116
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));
120
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 **));
124
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 *));
129
130 /* Run to list the command line options which parse_args handles. */
131 void (* list_options) PARAMS ((FILE *));
132
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 *));
137
138} ld_emulation_xfer_type;
139
140typedef enum
141{
142 intel_ic960_ld_mode_enum,
143 default_mode_enum ,
144 intel_gld960_ld_mode_enum
145} lang_emulation_mode_enum_type;
146
147extern ld_emulation_xfer_type *ld_emulations[];
148
149#endif
This page took 0.122304 seconds and 4 git commands to generate.