* Many files: Added gettext invocations around user-visible
[external/binutils.git] / ld / ld.h
1 /* ld.h -- general linker header file
2    Copyright (C) 1991, 93, 94, 95, 96, 1997, 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 2, 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    You should have received a copy of the GNU General Public License
17    along with GLD; see the file COPYING.  If not, write to the Free
18    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19    02111-1307, USA.  */
20
21 #ifndef LD_H
22 #define LD_H
23
24 #ifdef ENABLE_NLS
25 #include <libintl.h>
26 #define _(String) gettext (String)
27 #ifdef gettext_noop
28 #define N_(String) gettext_noop (String)
29 #else
30 #define N_(String) (String)
31 #endif
32 #else
33 /* Stubs that do something close enough.  */
34 #define textdomain(String) (String)
35 #define gettext(String) (String)
36 #define dgettext(Domain,Message) (Message)
37 #define dcgettext(Domain,Message,Type) (Message)
38 #define bindtextdomain(Domain,Directory) (Domain)
39 #define _(String) (String)
40 #define N_(String) (String)
41 /* In this case we don't care about the value.  */
42 #ifndef LC_MESSAGES
43 #define LC_MESSAGES 0
44 #endif
45 #endif
46
47 /* Look in this environment name for the linker to pretend to be */
48 #define EMULATION_ENVIRON "LDEMULATION"
49 /* If in there look for the strings: */
50
51 /* Look in this variable for a target format */
52 #define TARGET_ENVIRON "GNUTARGET"
53
54 /* Input sections which are put in a section of this name are actually
55    discarded.  */
56 #define DISCARD_SECTION_NAME "/DISCARD/"
57
58 /* Extra information we hold on sections */
59 typedef struct  user_section_struct
60 {
61   /* Pointer to the section where this data will go */
62   struct lang_input_statement_struct *file;
63 } section_userdata_type;
64
65
66 #define get_userdata(x) ((x)->userdata)
67
68 #define BYTE_SIZE       (1)
69 #define SHORT_SIZE      (2)
70 #define LONG_SIZE       (4)
71 #define QUAD_SIZE       (8)
72
73 /* ALIGN macro changed to ALIGN_N to avoid      */
74 /* conflict in /usr/include/machine/machparam.h */
75 /* WARNING: If THIS is a 64 bit address and BOUNDARY is a 32 bit int,
76    you must coerce boundary to the same type as THIS.
77    ??? Is there a portable way to avoid this.  */
78 #define ALIGN_N(this, boundary) \
79   ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
80
81 typedef struct
82 {
83   /* 1 => assign space to common symbols even if `relocatable_output'.  */
84   boolean force_common_definition;
85   boolean relax;
86
87   /* Name of runtime interpreter to invoke.  */
88   char *interpreter;
89
90   /* Name to give runtime libary from the -soname argument.  */
91   char *soname;
92
93   /* Runtime library search path from the -rpath argument.  */
94   char *rpath;
95
96   /* Link time runtime library search path from the -rpath-link
97      argument.  */
98   char *rpath_link;
99
100   /* Big or little endian as set on command line.  */
101   enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
102
103   /* If true, export all symbols in the dynamic symbol table of an ELF
104      executable.  */
105   boolean export_dynamic;
106
107   /* If true, build MIPS embedded PIC relocation tables in the output
108      file.  */
109   boolean embedded_relocs;
110
111   /* If true, force generation of a file with a .exe file. */
112   boolean force_exe_suffix;
113
114   /* If true, generate a cross reference report.  */
115   boolean cref;
116
117   /* If true (which is the default), warn about mismatched input
118      files.  */
119   boolean warn_mismatch;
120
121   /* Name of shared object whose symbol table should be filtered with
122      this shared object.  From the --filter option.  */
123   char *filter_shlib;
124
125   /* Name of shared object for whose symbol table this shared object
126      is an auxiliary filter.  From the --auxiliary option.  */
127   char **auxiliary_filters;
128 } args_type;
129
130 extern args_type command_line;
131
132 typedef int token_code_type;
133
134 typedef struct 
135 {
136   bfd_size_type specified_data_size;
137   boolean magic_demand_paged;
138   boolean make_executable;
139
140   /* If true, doing a dynamic link.  */
141   boolean dynamic_link;
142
143   /* If true, build constructors.  */
144   boolean build_constructors;
145
146   /* If true, warn about any constructors.  */
147   boolean warn_constructors;
148
149   /* If true, warn about merging common symbols with others.  */
150   boolean warn_common;
151
152   /* If true, only warn once about a particular undefined symbol.  */
153   boolean warn_once;
154
155   /* If true, warn if multiple global-pointers are needed (Alpha
156      only).  */
157   boolean warn_multiple_gp;
158
159   /* If true, warn if the starting address of an output section
160      changes due to the alignment of an input section.  */
161   boolean warn_section_align;
162
163   boolean sort_common;
164
165   boolean text_read_only;
166
167   char *map_filename;
168   FILE *map_file;
169
170   boolean stats;
171
172   int split_by_reloc;
173   boolean split_by_file;
174 } ld_config_type;
175
176 extern ld_config_type config;
177
178 typedef enum
179 {
180   lang_first_phase_enum,
181   lang_allocating_phase_enum,
182   lang_final_phase_enum
183 } lang_phase_type;
184
185 extern boolean had_script;
186 extern boolean force_make_executable;
187
188 /* Non-zero if we are processing a --defsym from the command line.  */
189 extern int parsing_defsym;
190
191 extern int yyparse PARAMS ((void));
192
193 extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma));
194 extern void output_cref PARAMS ((FILE *));
195 extern void check_nocrossrefs PARAMS ((void));
196
197 #endif