1 /* ld.h -- general linker header file
2 Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 99, 2000
3 Free Software Foundation, Inc.
5 This file is part of GLD, the Gnu Linker.
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 2, or (at your option)
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.
17 You should have received a copy of the GNU General Public License
18 along with GLD; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
31 # define _(String) gettext (String)
33 # define N_(String) gettext_noop (String)
35 # define N_(String) (String)
38 # define gettext(Msgid) (Msgid)
39 # define dgettext(Domainname, Msgid) (Msgid)
40 # define dcgettext(Domainname, Msgid, Category) (Msgid)
41 # define textdomain(Domainname) while (0) /* nothing */
42 # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
43 # define _(String) (String)
44 # define N_(String) (String)
49 /* Look in this environment name for the linker to pretend to be */
50 #define EMULATION_ENVIRON "LDEMULATION"
51 /* If in there look for the strings: */
53 /* Look in this variable for a target format */
54 #define TARGET_ENVIRON "GNUTARGET"
56 /* Input sections which are put in a section of this name are actually
58 #define DISCARD_SECTION_NAME "/DISCARD/"
60 /* A file name list */
61 typedef struct name_list
{
63 struct name_list
*next
;
67 /* A wildcard specification. This is only used in ldgram.y, but it
68 winds up in ldgram.h, so we need to define it outside. */
70 struct wildcard_spec
{
72 struct name_list
*exclude_name_list
;
76 /* Extra information we hold on sections */
77 typedef struct user_section_struct
{
78 /* Pointer to the section where this data will go */
79 struct lang_input_statement_struct
*file
;
80 } section_userdata_type
;
82 #define get_userdata(x) ((x)->userdata)
85 #define SHORT_SIZE (2)
89 /* ALIGN macro changed to ALIGN_N to avoid */
90 /* conflict in /usr/include/machine/machparam.h */
91 /* WARNING: If THIS is a 64 bit address and BOUNDARY is a 32 bit int,
92 you must coerce boundary to the same type as THIS.
93 ??? Is there a portable way to avoid this. */
94 #define ALIGN_N(this, boundary) \
95 ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
98 /* 1 => assign space to common symbols even if `relocatable_output'. */
99 boolean force_common_definition
;
102 /* Name of runtime interpreter to invoke. */
105 /* Name to give runtime libary from the -soname argument. */
108 /* Runtime library search path from the -rpath argument. */
111 /* Link time runtime library search path from the -rpath-link
115 /* Big or little endian as set on command line. */
116 enum { ENDIAN_UNSET
= 0, ENDIAN_BIG
, ENDIAN_LITTLE
} endian
;
118 /* If true, export all symbols in the dynamic symbol table of an ELF
120 boolean export_dynamic
;
122 /* If true, build MIPS embedded PIC relocation tables in the output
124 boolean embedded_relocs
;
126 /* If true, force generation of a file with a .exe file. */
127 boolean force_exe_suffix
;
129 /* If true, generate a cross reference report. */
132 /* If true (which is the default), warn about mismatched input
134 boolean warn_mismatch
;
136 /* Remove unreferenced sections? */
139 /* Name of shared object whose symbol table should be filtered with
140 this shared object. From the --filter option. */
143 /* Name of shared object for whose symbol table this shared object
144 is an auxiliary filter. From the --auxiliary option. */
145 char **auxiliary_filters
;
147 /* A version symbol to be applied to the symbol names found in the
148 .exports sections. */
149 char *version_exports_section
;
151 /* If true (the default) check section addresses, once compute,
153 boolean check_section_addresses
;
157 extern args_type command_line
;
159 typedef int token_code_type
;
162 bfd_size_type specified_data_size
;
163 boolean magic_demand_paged
;
164 boolean make_executable
;
166 /* If true, doing a dynamic link. */
167 boolean dynamic_link
;
169 /* If true, -shared is supported. */
170 /* ??? A better way to do this is perhaps to define this in the
171 ld_emulation_xfer_struct since this is really a target dependent
175 /* If true, build constructors. */
176 boolean build_constructors
;
178 /* If true, warn about any constructors. */
179 boolean warn_constructors
;
181 /* If true, warn about merging common symbols with others. */
184 /* If true, only warn once about a particular undefined symbol. */
187 /* If true, warn if multiple global-pointers are needed (Alpha
189 boolean warn_multiple_gp
;
191 /* If true, warn if the starting address of an output section
192 changes due to the alignment of an input section. */
193 boolean warn_section_align
;
197 boolean text_read_only
;
204 /* If set, orphan input sections will be mapped to separate output
206 boolean unique_orphan_sections
;
208 unsigned int split_by_reloc
;
209 bfd_size_type split_by_file
;
212 extern ld_config_type config
;
215 lang_first_phase_enum
,
216 lang_allocating_phase_enum
,
217 lang_final_phase_enum
220 extern boolean had_script
;
221 extern boolean force_make_executable
;
223 /* Non-zero if we are processing a --defsym from the command line. */
224 extern int parsing_defsym
;
226 extern int yyparse
PARAMS ((void));
228 extern void add_cref
PARAMS ((const char *, bfd
*, asection
*, bfd_vma
));
229 extern void output_cref
PARAMS ((FILE *));
230 extern void check_nocrossrefs
PARAMS ((void));
232 extern void ld_abort
PARAMS ((const char *, int, const char *))
235 /* If gcc >= 2.6, we can give a function name, too. */
236 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
237 #define __PRETTY_FUNCTION__ ((char*) NULL)
241 #define abort() ld_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)