00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef LD_H
00028 #define LD_H
00029
00030 #ifdef HAVE_LOCALE_H
00031 # include <locale.h>
00032 #endif
00033
00034 #ifdef ENABLE_NLS
00035 # include <libintl.h>
00036 # define _(String) gettext (String)
00037 # ifdef gettext_noop
00038 # define N_(String) gettext_noop (String)
00039 # else
00040 # define N_(String) (String)
00041 # endif
00042 #else
00043 # define gettext(Msgid) (Msgid)
00044 # define dgettext(Domainname, Msgid) (Msgid)
00045 # define dcgettext(Domainname, Msgid, Category) (Msgid)
00046 # define textdomain(Domainname) while (0)
00047 # define bindtextdomain(Domainname, Dirname) while (0)
00048 # define _(String) (String)
00049 # define N_(String) (String)
00050 #endif
00051
00052 #include "bin-bugs.h"
00053
00054
00055 #define EMULATION_ENVIRON "LDEMULATION"
00056
00057
00058
00059 #define TARGET_ENVIRON "GNUTARGET"
00060
00061
00062
00063 #define DISCARD_SECTION_NAME "/DISCARD/"
00064
00065
00066 typedef struct name_list {
00067 const char *name;
00068 struct name_list *next;
00069 }
00070 name_list;
00071
00072
00073
00074 typedef enum {
00075 none, by_name, by_alignment, by_name_alignment, by_alignment_name
00076 } sort_type;
00077
00078 extern sort_type sort_section;
00079
00080 struct wildcard_spec {
00081 const char *name;
00082 struct name_list *exclude_name_list;
00083 sort_type sorted;
00084 };
00085
00086 struct wildcard_list {
00087 struct wildcard_list *next;
00088 struct wildcard_spec spec;
00089 };
00090
00091 struct map_symbol_def {
00092 struct bfd_link_hash_entry *entry;
00093 struct map_symbol_def *next;
00094 };
00095
00096
00097 typedef struct lean_user_section_struct {
00098
00099 struct lang_input_statement_struct *file;
00100 } lean_section_userdata_type;
00101
00102
00103
00104 typedef struct fat_user_section_struct {
00105
00106 struct lang_input_statement_struct *file;
00107
00108
00109 struct map_symbol_def *map_symbol_def_head;
00110 struct map_symbol_def **map_symbol_def_tail;
00111 } fat_section_userdata_type;
00112
00113 #define SECTION_USERDATA_SIZE \
00114 (command_line.reduce_memory_overheads \
00115 ? sizeof (lean_section_userdata_type) \
00116 : sizeof (fat_section_userdata_type))
00117
00118 #define get_userdata(x) ((x)->userdata)
00119
00120 #define BYTE_SIZE (1)
00121 #define SHORT_SIZE (2)
00122 #define LONG_SIZE (4)
00123 #define QUAD_SIZE (8)
00124
00125 typedef struct {
00126
00127 bfd_boolean force_common_definition;
00128
00129
00130 bfd_boolean inhibit_common_definition;
00131 bfd_boolean relax;
00132
00133
00134 char *interpreter;
00135
00136
00137 char *soname;
00138
00139
00140 char *rpath;
00141
00142
00143
00144 char *rpath_link;
00145
00146
00147 enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
00148
00149
00150
00151 bfd_boolean embedded_relocs;
00152
00153
00154 bfd_boolean force_exe_suffix;
00155
00156
00157 bfd_boolean cref;
00158
00159
00160
00161 bfd_boolean warn_mismatch;
00162
00163
00164 bfd_boolean gc_sections;
00165
00166
00167
00168 char *filter_shlib;
00169
00170
00171
00172 char **auxiliary_filters;
00173
00174
00175
00176 char *version_exports_section;
00177
00178
00179
00180 bfd_boolean check_section_addresses;
00181
00182
00183
00184
00185
00186 bfd_boolean accept_unknown_input_arch;
00187
00188
00189
00190 bfd_boolean reduce_memory_overheads;
00191
00192 } args_type;
00193
00194 extern args_type command_line;
00195
00196 typedef int token_code_type;
00197
00198 typedef struct {
00199 bfd_size_type specified_data_size;
00200 bfd_boolean magic_demand_paged;
00201 bfd_boolean make_executable;
00202
00203
00204 bfd_boolean dynamic_link;
00205
00206
00207
00208
00209
00210 bfd_boolean has_shared;
00211
00212
00213 bfd_boolean build_constructors;
00214
00215
00216 bfd_boolean warn_constructors;
00217
00218
00219 bfd_boolean warn_common;
00220
00221
00222 bfd_boolean warn_once;
00223
00224
00225
00226 bfd_boolean warn_multiple_gp;
00227
00228
00229
00230 bfd_boolean warn_section_align;
00231
00232
00233 bfd_boolean fatal_warnings;
00234
00235 bfd_boolean sort_common;
00236
00237 bfd_boolean text_read_only;
00238
00239 char *map_filename;
00240 FILE *map_file;
00241
00242 bfd_boolean stats;
00243
00244
00245
00246 bfd_boolean unique_orphan_sections;
00247
00248 unsigned int split_by_reloc;
00249 bfd_size_type split_by_file;
00250
00251
00252
00253 bfd_boolean only_cmd_line_lib_dirs;
00254
00255
00256 bfd_size_type hash_table_size;
00257 } ld_config_type;
00258
00259 extern ld_config_type config;
00260
00261 typedef enum {
00262 lang_first_phase_enum,
00263 lang_allocating_phase_enum,
00264 lang_final_phase_enum
00265 } lang_phase_type;
00266
00267 extern FILE * saved_script_handle;
00268 extern bfd_boolean force_make_executable;
00269
00270
00271 extern int parsing_defsym;
00272
00273 extern int yyparse (void);
00274 extern void add_cref (const char *, bfd *, asection *, bfd_vma);
00275 extern void output_cref (FILE *);
00276 extern void check_nocrossrefs (void);
00277 extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
00278
00279
00280 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
00281 #define __PRETTY_FUNCTION__ NULL
00282 #endif
00283
00284 #undef abort
00285 #define abort() ld_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
00286
00287 #endif