]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/lexsup.c
Force relocs emited for an executable to contain virtual addresses.
[thirdparty/binutils-gdb.git] / ld / lexsup.c
CommitLineData
252b5132 1/* Parse options for the GNU linker.
93697284 2 Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
252b5132
RH
3 Free Software Foundation, Inc.
4
5This file is part of GLD, the Gnu Linker.
6
7GLD is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GLD is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GLD; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
21
22#include "bfd.h"
23#include "sysdep.h"
24#include "libiberty.h"
25#include <stdio.h>
26#include <string.h>
27#include <ctype.h>
28#include "getopt.h"
29#include "bfdlink.h"
30#include "ld.h"
31#include "ldmain.h"
32#include "ldmisc.h"
33#include "ldexp.h"
34#include "ldlang.h"
35#include "ldgram.h"
36#include "ldlex.h"
37#include "ldfile.h"
38#include "ldver.h"
39#include "ldemul.h"
40
41#ifndef PATH_SEPARATOR
42#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__))
43#define PATH_SEPARATOR ';'
44#else
45#define PATH_SEPARATOR ':'
46#endif
47#endif
48
49/* Somewhere above, sys/stat.h got included . . . . */
50#if !defined(S_ISDIR) && defined(S_IFDIR)
51#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
52#endif
53
54/* Omit args to avoid the possibility of clashing with a system header
55 that might disagree about consts. */
56unsigned long strtoul ();
57
3d9f6277 58static int is_num PARAMS ((const char *, int, int, int));
252b5132
RH
59static void set_default_dirlist PARAMS ((char *dirlist_ptr));
60static void set_section_start PARAMS ((char *sect, char *valstr));
61static void help PARAMS ((void));
62
63/* Non-zero if we are processing a --defsym from the command line. */
64int parsing_defsym = 0;
65
66/* Codes used for the long options with no short synonyms. 150 isn't
67 special; it's just an arbitrary non-ASCII char value. */
68
69#define OPTION_ASSERT 150
70#define OPTION_CALL_SHARED (OPTION_ASSERT + 1)
71#define OPTION_CREF (OPTION_CALL_SHARED + 1)
72#define OPTION_DEFSYM (OPTION_CREF + 1)
73#define OPTION_DEMANGLE (OPTION_DEFSYM + 1)
74#define OPTION_DYNAMIC_LINKER (OPTION_DEMANGLE + 1)
75#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
76#define OPTION_EL (OPTION_EB + 1)
77#define OPTION_EMBEDDED_RELOCS (OPTION_EL + 1)
78#define OPTION_EXPORT_DYNAMIC (OPTION_EMBEDDED_RELOCS + 1)
79#define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1)
80#define OPTION_IGNORE (OPTION_HELP + 1)
81#define OPTION_MAP (OPTION_IGNORE + 1)
82#define OPTION_NO_DEMANGLE (OPTION_MAP + 1)
83#define OPTION_NO_KEEP_MEMORY (OPTION_NO_DEMANGLE + 1)
84#define OPTION_NO_WARN_MISMATCH (OPTION_NO_KEEP_MEMORY + 1)
85#define OPTION_NOINHIBIT_EXEC (OPTION_NO_WARN_MISMATCH + 1)
86#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
87#define OPTION_NO_WHOLE_ARCHIVE (OPTION_NON_SHARED + 1)
88#define OPTION_OFORMAT (OPTION_NO_WHOLE_ARCHIVE + 1)
89#define OPTION_RELAX (OPTION_OFORMAT + 1)
90#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1)
91#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1)
92#define OPTION_RPATH_LINK (OPTION_RPATH + 1)
93#define OPTION_SHARED (OPTION_RPATH_LINK + 1)
94#define OPTION_SONAME (OPTION_SHARED + 1)
95#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
96#define OPTION_STATS (OPTION_SORT_COMMON + 1)
97#define OPTION_SYMBOLIC (OPTION_STATS + 1)
98#define OPTION_TASK_LINK (OPTION_SYMBOLIC + 1)
99#define OPTION_TBSS (OPTION_TASK_LINK + 1)
100#define OPTION_TDATA (OPTION_TBSS + 1)
101#define OPTION_TTEXT (OPTION_TDATA + 1)
102#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
103#define OPTION_UR (OPTION_TRADITIONAL_FORMAT + 1)
104#define OPTION_VERBOSE (OPTION_UR + 1)
105#define OPTION_VERSION (OPTION_VERBOSE + 1)
106#define OPTION_VERSION_SCRIPT (OPTION_VERSION + 1)
107#define OPTION_VERSION_EXPORTS_SECTION (OPTION_VERSION_SCRIPT + 1)
108#define OPTION_WARN_COMMON (OPTION_VERSION_EXPORTS_SECTION + 1)
109#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
110#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_CONSTRUCTORS + 1)
111#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
112#define OPTION_WARN_SECTION_ALIGN (OPTION_WARN_ONCE + 1)
113#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
114#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
115#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
116#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
117#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
118#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1)
119#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1)
120#define OPTION_CHECK_SECTIONS (OPTION_NO_GC_SECTIONS + 1)
121#define OPTION_NO_CHECK_SECTIONS (OPTION_CHECK_SECTIONS + 1)
122#define OPTION_MPC860C0 (OPTION_NO_CHECK_SECTIONS + 1)
123#define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1)
3dbf70a2
MM
124#define OPTION_INIT (OPTION_NO_UNDEFINED + 1)
125#define OPTION_FINI (OPTION_INIT + 1)
252b5132
RH
126
127/* The long options. This structure is used for both the option
128 parsing and the help text. */
129
130struct ld_option
131{
132 /* The long option information. */
133 struct option opt;
134 /* The short option with the same meaning ('\0' if none). */
135 char shortopt;
136 /* The name of the argument (NULL if none). */
137 const char *arg;
138 /* The documentation string. If this is NULL, this is a synonym for
139 the previous option. */
140 const char *doc;
141 enum
142 {
143 /* Use one dash before long option name. */
144 ONE_DASH,
145 /* Use two dashes before long option name. */
146 TWO_DASHES,
147 /* Don't mention this option in --help output. */
148 NO_HELP
149 } control;
150};
151
152static const struct ld_option ld_options[] =
153{
154 { {NULL, required_argument, NULL, '\0'},
155 'a', N_("KEYWORD"), N_("Shared library control for HP/UX compatibility"),
156 ONE_DASH },
157 { {"architecture", required_argument, NULL, 'A'},
158 'A', N_("ARCH"), N_("Set architecture") , TWO_DASHES },
159 { {"format", required_argument, NULL, 'b'},
160 'b', N_("TARGET"), N_("Specify target for following input files"), TWO_DASHES },
161 { {"mri-script", required_argument, NULL, 'c'},
162 'c', N_("FILE"), N_("Read MRI format linker script"), TWO_DASHES },
163 { {"dc", no_argument, NULL, 'd'},
164 'd', NULL, N_("Force common symbols to be defined"), ONE_DASH },
165 { {"dp", no_argument, NULL, 'd'},
166 '\0', NULL, NULL, ONE_DASH },
167 { {"entry", required_argument, NULL, 'e'},
168 'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES },
169 { {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
170 'E', NULL, N_("Export all dynamic symbols"), TWO_DASHES },
171 { {"EB", no_argument, NULL, OPTION_EB},
172 '\0', NULL, N_("Link big-endian objects"), ONE_DASH },
173 { {"EL", no_argument, NULL, OPTION_EL},
174 '\0', NULL, N_("Link little-endian objects"), ONE_DASH },
175 { {"auxiliary", required_argument, NULL, 'f'},
176 'f', N_("SHLIB"), N_("Auxiliary filter for shared object symbol table"),
177 TWO_DASHES },
178 { {"filter", required_argument, NULL, 'F'},
179 'F', N_("SHLIB"), N_("Filter for shared object symbol table"), TWO_DASHES },
180 { {NULL, no_argument, NULL, '\0'},
181 'g', NULL, N_("Ignored"), ONE_DASH },
182 { {"gpsize", required_argument, NULL, 'G'},
183 'G', N_("SIZE"), N_("Small data size (if no size, same as --shared)"),
184 TWO_DASHES },
185 { {"soname", required_argument, NULL, OPTION_SONAME},
186 'h', N_("FILENAME"), N_("Set internal name of shared library"), ONE_DASH },
187 { {"library", required_argument, NULL, 'l'},
188 'l', N_("LIBNAME"), N_("Search for library LIBNAME"), TWO_DASHES },
189 { {"library-path", required_argument, NULL, 'L'},
190 'L', N_("DIRECTORY"), N_("Add DIRECTORY to library search path"), TWO_DASHES },
191 { {NULL, required_argument, NULL, '\0'},
192 'm', N_("EMULATION"), N_("Set emulation"), ONE_DASH },
193 { {"print-map", no_argument, NULL, 'M'},
194 'M', NULL, N_("Print map file on standard output"), TWO_DASHES },
195 { {"nmagic", no_argument, NULL, 'n'},
196 'n', NULL, N_("Do not page align data"), TWO_DASHES },
197 { {"omagic", no_argument, NULL, 'N'},
198 'N', NULL, N_("Do not page align data, do not make text readonly"),
199 TWO_DASHES },
200 { {"output", required_argument, NULL, 'o'},
201 'o', N_("FILE"), N_("Set output file name"), TWO_DASHES },
202 { {NULL, required_argument, NULL, '\0'},
203 'O', NULL, N_("Optimize output file"), ONE_DASH },
204 { {"Qy", no_argument, NULL, OPTION_IGNORE},
205 '\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
a712da20
NC
206 { {"emit-relocs", no_argument, NULL, 'q'},
207 'q', NULL, "Generate relocations in final output", TWO_DASHES },
079a8e4a
NC
208 { {"relocateable", no_argument, NULL, 'r'},
209 'r', NULL, N_("Generate relocateable output"), TWO_DASHES },
252b5132
RH
210 { {NULL, no_argument, NULL, '\0'},
211 'i', NULL, NULL, ONE_DASH },
212 { {"just-symbols", required_argument, NULL, 'R'},
213 'R', N_("FILE"), N_("Just link symbols (if directory, same as --rpath)"),
214 TWO_DASHES },
215 { {"strip-all", no_argument, NULL, 's'},
216 's', NULL, N_("Strip all symbols"), TWO_DASHES },
217 { {"strip-debug", no_argument, NULL, 'S'},
218 'S', NULL, N_("Strip debugging symbols"), TWO_DASHES },
219 { {"trace", no_argument, NULL, 't'},
220 't', NULL, N_("Trace file opens"), TWO_DASHES },
221 { {"script", required_argument, NULL, 'T'},
222 'T', N_("FILE"), N_("Read linker script"), TWO_DASHES },
223 { {"undefined", required_argument, NULL, 'u'},
224 'u', N_("SYMBOL"), N_("Start with undefined reference to SYMBOL"), TWO_DASHES },
225 { {"Ur", no_argument, NULL, OPTION_UR},
226 '\0', NULL, N_("Build global constructor/destructor tables"), ONE_DASH },
227 { {"version", no_argument, NULL, OPTION_VERSION},
228 'v', NULL, N_("Print version information"), TWO_DASHES },
229 { {NULL, no_argument, NULL, '\0'},
230 'V', NULL, N_("Print version and emulation information"), ONE_DASH },
231 { {"discard-all", no_argument, NULL, 'x'},
232 'x', NULL, N_("Discard all local symbols"), TWO_DASHES },
233 { {"discard-locals", no_argument, NULL, 'X'},
234 'X', NULL, N_("Discard temporary local symbols"), TWO_DASHES },
235 { {"trace-symbol", required_argument, NULL, 'y'},
236 'y', N_("SYMBOL"), N_("Trace mentions of SYMBOL"), TWO_DASHES },
237 { {NULL, required_argument, NULL, '\0'},
238 'Y', N_("PATH"), N_("Default search path for Solaris compatibility"), ONE_DASH },
239 { {NULL, required_argument, NULL, '\0'},
240 'z', N_("KEYWORD"), N_("Ignored for Solaris compatibility"), ONE_DASH },
241 { {"start-group", no_argument, NULL, '('},
242 '(', NULL, N_("Start a group"), TWO_DASHES },
243 { {"end-group", no_argument, NULL, ')'},
244 ')', NULL, N_("End a group"), TWO_DASHES },
245 { {"assert", required_argument, NULL, OPTION_ASSERT},
246 '\0', N_("KEYWORD"), N_("Ignored for SunOS compatibility"), ONE_DASH },
247 { {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
248 '\0', NULL, N_("Link against shared libraries"), ONE_DASH },
249 { {"dy", no_argument, NULL, OPTION_CALL_SHARED},
250 '\0', NULL, NULL, ONE_DASH },
251 { {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
252 '\0', NULL, NULL, ONE_DASH },
253 { {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
254 '\0', NULL, N_("Do not link against shared libraries"), ONE_DASH },
255 { {"dn", no_argument, NULL, OPTION_NON_SHARED},
256 '\0', NULL, NULL, ONE_DASH },
257 { {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
258 '\0', NULL, NULL, ONE_DASH },
259 { {"static", no_argument, NULL, OPTION_NON_SHARED},
260 '\0', NULL, NULL, ONE_DASH },
261 { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
262 '\0', NULL, N_("Bind global references locally"), ONE_DASH },
263 { {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
264 '\0', NULL, N_("Check section addresses for overlaps (default)"), TWO_DASHES },
265 { {"no-check-sections", no_argument, NULL, OPTION_NO_CHECK_SECTIONS},
266 '\0', NULL, N_("Do not check section addresses for overlaps"),
267 TWO_DASHES },
268 { {"cref", no_argument, NULL, OPTION_CREF},
269 '\0', NULL, N_("Output cross reference table"), TWO_DASHES },
270 { {"defsym", required_argument, NULL, OPTION_DEFSYM},
271 '\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
272 { {"demangle", no_argument, NULL, OPTION_DEMANGLE},
273 '\0', NULL, N_("Demangle symbol names"), TWO_DASHES },
274 { {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
275 '\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
276 { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
277 '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES},
3dbf70a2
MM
278 { {"fini", required_argument, NULL, OPTION_FINI},
279 '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH },
252b5132
RH
280 { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX},
281 '\0', NULL, N_("Force generation of file with .exe suffix"), TWO_DASHES},
282 { {"gc-sections", no_argument, NULL, OPTION_GC_SECTIONS},
283 '\0', NULL, N_("Remove unused sections (on some targets)"),
284 TWO_DASHES },
285 { {"no-gc-sections", no_argument, NULL, OPTION_NO_GC_SECTIONS},
286 '\0', NULL, N_("Don't remove unused sections (default)"),
287 TWO_DASHES },
288 { {"help", no_argument, NULL, OPTION_HELP},
289 '\0', NULL, N_("Print option help"), TWO_DASHES },
3dbf70a2
MM
290 { {"init", required_argument, NULL, OPTION_INIT},
291 '\0', N_("SYMBOL"), N_("Call SYMBOL at load-time"), ONE_DASH },
252b5132
RH
292 { {"Map", required_argument, NULL, OPTION_MAP},
293 '\0', N_("FILE"), N_("Write a map file"), ONE_DASH },
294 { {"no-demangle", no_argument, NULL, OPTION_NO_DEMANGLE },
295 '\0', NULL, N_("Do not demangle symbol names"), TWO_DASHES },
296 { {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
297 '\0', NULL, N_("Use less memory and more disk I/O"), TWO_DASHES },
298 { {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
299 '\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES },
300 { {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
301 '\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
302 { {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
303 '\0', NULL, N_("Turn off --whole-archive"), TWO_DASHES },
304 { {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
305 '\0', NULL, N_("Create an output file even if errors occur"), TWO_DASHES },
306 { {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
307 '\0', NULL, NULL, NO_HELP },
308 { {"oformat", required_argument, NULL, OPTION_OFORMAT},
309 '\0', N_("TARGET"), N_("Specify target of output file"), TWO_DASHES },
310 { {"qmagic", no_argument, NULL, OPTION_IGNORE},
311 '\0', NULL, N_("Ignored for Linux compatibility"), ONE_DASH },
312 { {"relax", no_argument, NULL, OPTION_RELAX},
313 '\0', NULL, N_("Relax branches on certain targets"), TWO_DASHES },
314 { {"retain-symbols-file", required_argument, NULL,
315 OPTION_RETAIN_SYMBOLS_FILE},
316 '\0', N_("FILE"), N_("Keep only symbols listed in FILE"), TWO_DASHES },
317 { {"rpath", required_argument, NULL, OPTION_RPATH},
318 '\0', N_("PATH"), N_("Set runtime shared library search path"), ONE_DASH },
319 { {"rpath-link", required_argument, NULL, OPTION_RPATH_LINK},
320 '\0', N_("PATH"), N_("Set link time shared library search path"), ONE_DASH },
321 { {"shared", no_argument, NULL, OPTION_SHARED},
322 '\0', NULL, N_("Create a shared library"), ONE_DASH },
323 { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */
324 '\0', NULL, NULL, ONE_DASH },
325 { {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
326 '\0', NULL, N_("Sort common symbols by size"), TWO_DASHES },
327 { {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
328 '\0', NULL, NULL, NO_HELP },
329 { {"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
330 '\0', NULL, N_("Split output sections for each file"), TWO_DASHES },
331 { {"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
332 '\0', N_("COUNT"), N_("Split output sections every COUNT relocs"), TWO_DASHES },
333 { {"stats", no_argument, NULL, OPTION_STATS},
334 '\0', NULL, N_("Print memory usage statistics"), TWO_DASHES },
335 { {"task-link", required_argument, NULL, OPTION_TASK_LINK},
336 '\0', N_("SYMBOL"), N_("Do task level linking"), TWO_DASHES },
337 { {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
338 '\0', NULL, N_("Use same format as native linker"), TWO_DASHES },
339 { {"Tbss", required_argument, NULL, OPTION_TBSS},
340 '\0', N_("ADDRESS"), N_("Set address of .bss section"), ONE_DASH },
341 { {"Tdata", required_argument, NULL, OPTION_TDATA},
342 '\0', N_("ADDRESS"), N_("Set address of .data section"), ONE_DASH },
343 { {"Ttext", required_argument, NULL, OPTION_TTEXT},
344 '\0', N_("ADDRESS"), N_("Set address of .text section"), ONE_DASH },
345 { {"verbose", no_argument, NULL, OPTION_VERBOSE},
346 '\0', NULL, N_("Output lots of information during link"), TWO_DASHES },
347 { {"dll-verbose", no_argument, NULL, OPTION_VERBOSE}, /* Linux. */
348 '\0', NULL, NULL, NO_HELP },
349 { {"version-script", required_argument, NULL, OPTION_VERSION_SCRIPT },
350 '\0', N_("FILE"), N_("Read version information script"), TWO_DASHES },
351 { {"version-exports-section", required_argument, NULL,
352 OPTION_VERSION_EXPORTS_SECTION },
b3043ee4 353 '\0', N_("SYMBOL"), N_("Take export symbols list from .exports, using\n\t\t\t\tSYMBOL as the version."),
252b5132
RH
354 TWO_DASHES },
355 { {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
356 '\0', NULL, N_("Warn about duplicate common symbols"), TWO_DASHES },
357 { {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
358 '\0', NULL, N_("Warn if global constructors/destructors are seen"),
359 TWO_DASHES },
360 { {"warn-multiple-gp", no_argument, NULL, OPTION_WARN_MULTIPLE_GP},
361 '\0', NULL, N_("Warn if the multiple GP values are used"), TWO_DASHES },
362 { {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
363 '\0', NULL, N_("Warn only once per undefined symbol"), TWO_DASHES },
364 { {"warn-section-align", no_argument, NULL, OPTION_WARN_SECTION_ALIGN},
365 '\0', NULL, N_("Warn if start of section changes due to alignment"),
366 TWO_DASHES },
367 { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
368 '\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
369 { {"wrap", required_argument, NULL, OPTION_WRAP},
370 '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
371 { {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
b3043ee4 372 '\0', N_("[=WORDS]"), N_("Modify problematic branches in last WORDS (1-10,\n\t\t\t\tdefault 5) words of a page"), TWO_DASHES }
252b5132
RH
373};
374
375#define OPTION_COUNT ((int) (sizeof ld_options / sizeof ld_options[0]))
376
3d9f6277
ILT
377/* Test STRING for containing a string of digits that form a number
378 between MIN and MAX. The return value is the number or ERR. */
379
380static int
381is_num (string, min, max, err)
382 const char *string;
383 int min;
384 int max;
385 int err;
252b5132
RH
386{
387 int result = 0;
388
3d9f6277 389 for (; *string; ++string)
252b5132 390 {
3d9f6277
ILT
391 if (! isdigit (*string))
392 {
393 result = err;
394 break;
395 }
396 result = result * 10 + (*string - '0');
252b5132 397 }
252b5132
RH
398 if (result < min || result > max)
399 result = err;
400
401 return result;
402}
403
404void
405parse_args (argc, argv)
406 int argc;
407 char **argv;
408{
409 int i, is, il;
410 int ingroup = 0;
411 char *default_dirlist = NULL;
412 char shortopts[OPTION_COUNT * 3 + 2];
413 struct option longopts[OPTION_COUNT + 1];
414 int last_optind;
415
416 /* Starting the short option string with '-' is for programs that
417 expect options and other ARGV-elements in any order and that care about
418 the ordering of the two. We describe each non-option ARGV-element
419 as if it were the argument of an option with character code 1. */
420 shortopts[0] = '-';
421 is = 1;
422 il = 0;
423 for (i = 0; i < OPTION_COUNT; i++)
424 {
425 if (ld_options[i].shortopt != '\0')
426 {
427 shortopts[is] = ld_options[i].shortopt;
428 ++is;
429 if (ld_options[i].opt.has_arg == required_argument
430 || ld_options[i].opt.has_arg == optional_argument)
431 {
432 shortopts[is] = ':';
433 ++is;
434 if (ld_options[i].opt.has_arg == optional_argument)
435 {
436 shortopts[is] = ':';
437 ++is;
438 }
439 }
440 }
441 if (ld_options[i].opt.name != NULL)
442 {
443 longopts[il] = ld_options[i].opt;
444 ++il;
445 }
446 }
447 shortopts[is] = '\0';
448 longopts[il].name = NULL;
449
450 /* The -G option is ambiguous on different platforms. Sometimes it
451 specifies the largest data size to put into the small data
452 section. Sometimes it is equivalent to --shared. Unfortunately,
453 the first form takes an argument, while the second does not.
454
455 We need to permit the --shared form because on some platforms,
456 such as Solaris, gcc -shared will pass -G to the linker.
457
458 To permit either usage, we look through the argument list. If we
459 find -G not followed by a number, we change it into --shared.
460 This will work for most normal cases. */
461 for (i = 1; i < argc; i++)
462 if (strcmp (argv[i], "-G") == 0
463 && (i + 1 >= argc
464 || ! isdigit ((unsigned char) argv[i + 1][0])))
465 argv[i] = (char *) "--shared";
466
467 /* Because we permit long options to start with a single dash, and
468 we have a --library option, and the -l option is conventionally
469 used with an immediately following argument, we can have bad
470 results if somebody tries to use -l with a library whose name
471 happens to start with "ibrary", as in -li. We avoid problems by
472 simply turning -l into --library. This means that users will
473 have to use two dashes in order to use --library, which is OK
474 since that's how it is documented.
475
476 FIXME: It's possible that this problem can arise for other short
477 options as well, although the user does always have the recourse
478 of adding a space between the option and the argument. */
479 for (i = 1; i < argc; i++)
480 {
481 if (argv[i][0] == '-'
482 && argv[i][1] == 'l'
483 && argv[i][2] != '\0')
484 {
485 char *n;
486
487 n = (char *) xmalloc (strlen (argv[i]) + 20);
488 sprintf (n, "--library=%s", argv[i] + 2);
489 argv[i] = n;
490 }
491 }
492
493 last_optind = -1;
494 while (1)
495 {
496 int longind;
497 int optc;
498
499 /* Using last_optind lets us avoid calling ldemul_parse_args
500 multiple times on a single option, which would lead to
501 confusion in the internal static variables maintained by
502 getopt. This could otherwise happen for an argument like
503 -nx, in which the -n is parsed as a single option, and we
504 loop around to pick up the -x. */
505 if (optind != last_optind)
506 {
507 if (ldemul_parse_args (argc, argv))
508 continue;
509 last_optind = optind;
510 }
511
512 /* getopt_long_only is like getopt_long, but '-' as well as '--'
513 can indicate a long option. */
514 optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
515
516 if (optc == -1)
517 break;
518 switch (optc)
519 {
520 default:
03983865
ILT
521 fprintf (stderr,
522 _("%s: use the --help option for usage information\n"),
523 program_name);
252b5132
RH
524 xexit (1);
525 case 1: /* File name. */
526 lang_add_input_file (optarg, lang_input_file_is_file_enum,
527 (char *) NULL);
528 break;
529
530 case OPTION_IGNORE:
531 break;
532 case 'a':
533 /* For HP/UX compatibility. Actually -a shared should mean
534 ``use only shared libraries'' but, then, we don't
535 currently support shared libraries on HP/UX anyhow. */
536 if (strcmp (optarg, "archive") == 0)
537 config.dynamic_link = false;
538 else if (strcmp (optarg, "shared") == 0
539 || strcmp (optarg, "default") == 0)
540 config.dynamic_link = true;
541 else
542 einfo (_("%P%F: unrecognized -a option `%s'\n"), optarg);
543 break;
544 case OPTION_ASSERT:
545 /* FIXME: We just ignore these, but we should handle them. */
546 if (strcmp (optarg, "definitions") == 0)
547 ;
548 else if (strcmp (optarg, "nodefinitions") == 0)
549 ;
550 else if (strcmp (optarg, "nosymbolic") == 0)
551 ;
552 else if (strcmp (optarg, "pure-text") == 0)
553 ;
554 else
555 einfo (_("%P%F: unrecognized -assert option `%s'\n"), optarg);
556 break;
557 case 'A':
558 ldfile_add_arch (optarg);
559 break;
560 case 'b':
561 lang_add_target (optarg);
562 break;
563 case 'c':
564 ldfile_open_command_file (optarg);
565 parser_input = input_mri_script;
566 yyparse ();
567 break;
568 case OPTION_CALL_SHARED:
569 config.dynamic_link = true;
570 break;
571 case OPTION_NON_SHARED:
572 config.dynamic_link = false;
573 break;
574 case OPTION_CREF:
575 command_line.cref = true;
576 link_info.notice_all = true;
577 break;
578 case 'd':
579 command_line.force_common_definition = true;
580 break;
581 case OPTION_DEFSYM:
582 lex_string = optarg;
583 lex_redirect (optarg);
584 parser_input = input_defsym;
585 parsing_defsym = 1;
586 yyparse ();
587 parsing_defsym = 0;
588 lex_string = NULL;
589 break;
590 case OPTION_DEMANGLE:
591 demangling = true;
592 break;
593 case OPTION_DYNAMIC_LINKER:
594 command_line.interpreter = optarg;
595 break;
596 case OPTION_EB:
597 command_line.endian = ENDIAN_BIG;
598 break;
599 case OPTION_EL:
600 command_line.endian = ENDIAN_LITTLE;
601 break;
602 case OPTION_EMBEDDED_RELOCS:
603 command_line.embedded_relocs = true;
604 break;
605 case OPTION_EXPORT_DYNAMIC:
606 case 'E': /* HP/UX compatibility. */
607 command_line.export_dynamic = true;
608 break;
609 case 'e':
610 lang_add_entry (optarg, true);
611 break;
612 case 'f':
613 if (command_line.auxiliary_filters == NULL)
614 {
615 command_line.auxiliary_filters =
616 (char **) xmalloc (2 * sizeof (char *));
617 command_line.auxiliary_filters[0] = optarg;
618 command_line.auxiliary_filters[1] = NULL;
619 }
620 else
621 {
622 int c;
623 char **p;
624
625 c = 0;
626 for (p = command_line.auxiliary_filters; *p != NULL; p++)
627 ++c;
628 command_line.auxiliary_filters =
629 (char **) xrealloc (command_line.auxiliary_filters,
630 (c + 2) * sizeof (char *));
631 command_line.auxiliary_filters[c] = optarg;
632 command_line.auxiliary_filters[c + 1] = NULL;
633 }
634 break;
635 case 'F':
636 command_line.filter_shlib = optarg;
637 break;
638 case OPTION_FORCE_EXE_SUFFIX:
639 command_line.force_exe_suffix = true;
640 break;
641 case 'G':
642 {
643 char *end;
644 g_switch_value = strtoul (optarg, &end, 0);
645 if (*end)
646 einfo (_("%P%F: invalid number `%s'\n"), optarg);
647 }
648 break;
649 case 'g':
650 /* Ignore. */
651 break;
652 case OPTION_GC_SECTIONS:
653 command_line.gc_sections = true;
654 break;
655 case OPTION_HELP:
656 help ();
657 xexit (0);
658 break;
659 case 'L':
660 ldfile_add_library_path (optarg, true);
661 break;
662 case 'l':
663 lang_add_input_file (optarg, lang_input_file_is_l_enum,
664 (char *) NULL);
665 break;
666 case 'M':
667 config.map_filename = "-";
668 break;
669 case 'm':
670 /* Ignore. Was handled in a pre-parse. */
671 break;
672 case OPTION_MAP:
673 config.map_filename = optarg;
674 break;
675 case 'N':
676 config.text_read_only = false;
677 config.magic_demand_paged = false;
678 config.dynamic_link = false;
679 break;
680 case 'n':
681 config.magic_demand_paged = false;
682 config.dynamic_link = false;
683 break;
684 case OPTION_NO_DEMANGLE:
685 demangling = false;
686 break;
687 case OPTION_NO_GC_SECTIONS:
688 command_line.gc_sections = false;
689 break;
690 case OPTION_NO_KEEP_MEMORY:
691 link_info.keep_memory = false;
692 break;
693 case OPTION_NO_UNDEFINED:
694 link_info.no_undefined = true;
695 break;
696 case OPTION_NO_WARN_MISMATCH:
697 command_line.warn_mismatch = false;
698 break;
699 case OPTION_NOINHIBIT_EXEC:
700 force_make_executable = true;
701 break;
702 case OPTION_NO_WHOLE_ARCHIVE:
703 whole_archive = false;
704 break;
705 case 'O':
706 /* FIXME "-O<non-digits> <value>" used to set the address of
707 section <non-digits>. Was this for compatibility with
708 something, or can we create a new option to do that
709 (with a syntax similar to -defsym)?
710 getopt can't handle two args to an option without kludges. */
711
712 /* Enable optimizations of output files. */
713 link_info.optimize = strtoul (optarg, NULL, 0) ? true : false;
714 break;
715 case 'o':
716 lang_add_output (optarg, 0);
717 break;
718 case OPTION_OFORMAT:
719 lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
720 break;
721 case 'i':
a712da20
NC
722 case 'q':
723 link_info.emitrelocations = true;
724 break;
252b5132
RH
725 case 'r':
726 link_info.relocateable = true;
727 config.build_constructors = false;
728 config.magic_demand_paged = false;
729 config.text_read_only = false;
730 config.dynamic_link = false;
731 break;
732 case 'R':
733 /* The GNU linker traditionally uses -R to mean to include
734 only the symbols from a file. The Solaris linker uses -R
735 to set the path used by the runtime linker to find
736 libraries. This is the GNU linker -rpath argument. We
737 try to support both simultaneously by checking the file
738 named. If it is a directory, rather than a regular file,
739 we assume -rpath was meant. */
740 {
741 struct stat s;
742
743 if (stat (optarg, &s) >= 0
744 && ! S_ISDIR (s.st_mode))
745 {
746 lang_add_input_file (optarg,
747 lang_input_file_is_symbols_only_enum,
748 (char *) NULL);
749 break;
750 }
751 }
752 /* Fall through. */
753 case OPTION_RPATH:
754 if (command_line.rpath == NULL)
755 command_line.rpath = buystring (optarg);
756 else
757 {
758 size_t rpath_len = strlen (command_line.rpath);
759 size_t optarg_len = strlen (optarg);
760 char *buf;
761 char *cp = command_line.rpath;
762
763 /* First see whether OPTARG is already in the path. */
764 do
765 {
766 size_t idx = 0;
767 while (optarg[idx] != '\0' && optarg[idx] == cp[idx])
768 ++idx;
769 if (optarg[idx] == '\0'
770 && (cp[idx] == '\0' || cp[idx] == ':'))
771 /* We found it. */
772 break;
773
774 /* Not yet found. */
775 cp = strchr (cp, ':');
776 if (cp != NULL)
777 ++cp;
778 }
779 while (cp != NULL);
780
781 if (cp == NULL)
782 {
783 buf = xmalloc (rpath_len + optarg_len + 2);
784 sprintf (buf, "%s:%s", command_line.rpath, optarg);
785 free (command_line.rpath);
786 command_line.rpath = buf;
787 }
788 }
789 break;
790 case OPTION_RPATH_LINK:
791 if (command_line.rpath_link == NULL)
792 command_line.rpath_link = buystring (optarg);
793 else
794 {
795 char *buf;
796
797 buf = xmalloc (strlen (command_line.rpath_link)
798 + strlen (optarg)
799 + 2);
800 sprintf (buf, "%s:%s", command_line.rpath_link, optarg);
801 free (command_line.rpath_link);
802 command_line.rpath_link = buf;
803 }
804 break;
805 case OPTION_RELAX:
806 command_line.relax = true;
807 break;
808 case OPTION_RETAIN_SYMBOLS_FILE:
809 add_keepsyms_file (optarg);
810 break;
811 case 'S':
812 link_info.strip = strip_debugger;
813 break;
814 case 's':
815 link_info.strip = strip_all;
816 break;
817 case OPTION_SHARED:
818 if (config.has_shared)
819 link_info.shared = true;
820 else
821 einfo (_("%P%F: -shared not supported\n"));
822 break;
823 case 'h': /* Used on Solaris. */
824 case OPTION_SONAME:
825 command_line.soname = optarg;
826 break;
827 case OPTION_SORT_COMMON:
828 config.sort_common = true;
829 break;
830 case OPTION_STATS:
831 config.stats = true;
832 break;
833 case OPTION_SYMBOLIC:
834 link_info.symbolic = true;
835 break;
836 case 't':
837 trace_files = true;
838 break;
839 case 'T':
840 ldfile_open_command_file (optarg);
841 parser_input = input_script;
842 yyparse ();
843 break;
844 case OPTION_TBSS:
845 set_section_start (".bss", optarg);
846 break;
847 case OPTION_TDATA:
848 set_section_start (".data", optarg);
849 break;
850 case OPTION_TTEXT:
851 set_section_start (".text", optarg);
852 break;
853 case OPTION_TRADITIONAL_FORMAT:
854 link_info.traditional_format = true;
855 break;
856 case OPTION_TASK_LINK:
857 link_info.task_link = true;
858 /* Fall through - do an implied -r option. */
859 case OPTION_UR:
860 link_info.relocateable = true;
861 config.build_constructors = true;
862 config.magic_demand_paged = false;
863 config.text_read_only = false;
864 config.dynamic_link = false;
865 break;
866 case 'u':
867 ldlang_add_undef (optarg);
868 break;
869 case OPTION_VERBOSE:
870 ldversion (1);
871 version_printed = true;
872 trace_file_tries = true;
873 break;
874 case 'v':
875 ldversion (0);
876 version_printed = true;
877 break;
878 case 'V':
879 ldversion (1);
880 version_printed = true;
881 break;
882 case OPTION_VERSION:
883 /* This output is intended to follow the GNU standards document. */
884 printf ("GNU ld %s\n", ld_program_version);
c2f1343c 885 printf (_("Copyright 2000 Free Software Foundation, Inc.\n"));
252b5132
RH
886 printf (_("\
887This program is free software; you may redistribute it under the terms of\n\
888the GNU General Public License. This program has absolutely no warranty.\n"));
889 {
890 ld_emulation_xfer_type **ptr = ld_emulations;
891
892 printf (_(" Supported emulations:\n"));
893 while (*ptr)
894 {
895 printf (" %s\n", (*ptr)->emulation_name);
896 ptr++;
897 }
898 }
899 xexit (0);
900 break;
901 case OPTION_VERSION_SCRIPT:
902 /* This option indicates a small script that only specifies
903 version information. Read it, but don't assume that
904 we've seen a linker script. */
905 {
906 boolean hold_had_script;
907
908 hold_had_script = had_script;
909 ldfile_open_command_file (optarg);
910 had_script = hold_had_script;
911 parser_input = input_version_script;
912 yyparse ();
913 }
914 break;
915 case OPTION_VERSION_EXPORTS_SECTION:
916 /* This option records a version symbol to be applied to the
917 symbols listed for export to be found in the object files
918 .exports sections. */
919 command_line.version_exports_section = optarg;
920 break;
921 case OPTION_WARN_COMMON:
922 config.warn_common = true;
923 break;
924 case OPTION_WARN_CONSTRUCTORS:
925 config.warn_constructors = true;
926 break;
927 case OPTION_WARN_MULTIPLE_GP:
928 config.warn_multiple_gp = true;
929 break;
930 case OPTION_WARN_ONCE:
931 config.warn_once = true;
932 break;
933 case OPTION_WARN_SECTION_ALIGN:
934 config.warn_section_align = true;
935 break;
936 case OPTION_WHOLE_ARCHIVE:
937 whole_archive = true;
938 break;
939 case OPTION_WRAP:
940 add_wrap (optarg);
941 break;
942 case 'X':
943 link_info.discard = discard_l;
944 break;
945 case 'x':
946 link_info.discard = discard_all;
947 break;
948 case 'Y':
949 if (strncmp (optarg, "P,", 2) == 0)
950 optarg += 2;
951 default_dirlist = xstrdup (optarg);
952 break;
953 case 'y':
954 add_ysym (optarg);
955 break;
956 case 'z':
957 /* We accept and ignore this option for Solaris
958 compatibility. Actually, on Solaris, optarg is not
959 ignored. Someday we should handle it correctly. FIXME. */
960 break;
961 case OPTION_SPLIT_BY_RELOC:
d98dd8ba 962 config.split_by_reloc = strtoul (optarg, NULL, 0);
252b5132
RH
963 break;
964 case OPTION_SPLIT_BY_FILE:
965 config.split_by_file = true;
966 break;
967 case OPTION_CHECK_SECTIONS:
968 command_line.check_section_addresses = true;
969 break;
970 case OPTION_NO_CHECK_SECTIONS:
971 command_line.check_section_addresses = false;
972 break;
973 case '(':
974 if (ingroup)
975 {
976 fprintf (stderr,
977 _("%s: may not nest groups (--help for usage)\n"),
978 program_name);
979 xexit (1);
980 }
981 lang_enter_group ();
982 ingroup = 1;
983 break;
984 case ')':
985 if (! ingroup)
986 {
987 fprintf (stderr,
988 _("%s: group ended before it began (--help for usage)\n"),
989 program_name);
990 xexit (1);
991 }
992 lang_leave_group ();
993 ingroup = 0;
994 break;
995 case OPTION_MPC860C0:
996 link_info.mpc860c0 = 20; /* default value (in bytes) */
997 if (optarg)
998 {
999 unsigned words;
1000
1001 words = is_num (optarg, 1, 10, 0);
1002 if (words == 0)
1003 {
3d9f6277
ILT
1004 fprintf (stderr,
1005 _("%s: Invalid argument to option \"mpc860c0\"\n"),
1006 program_name);
252b5132
RH
1007 xexit (1);
1008 }
1009 link_info.mpc860c0 = words * 4; /* convert words to bytes */
1010 }
1011 command_line.relax = true;
1012 break;
3dbf70a2
MM
1013
1014 case OPTION_INIT:
1015 link_info.init_function = optarg;
1016 break;
1017
1018 case OPTION_FINI:
1019 link_info.fini_function = optarg;
1020 break;
252b5132
RH
1021 }
1022 }
1023
1024 if (ingroup)
1025 lang_leave_group ();
1026
1027 if (default_dirlist != NULL)
1028 set_default_dirlist (default_dirlist);
1029
1030}
1031
1032/* Add the (colon-separated) elements of DIRLIST_PTR to the
1033 library search path. */
1034
1035static void
1036set_default_dirlist (dirlist_ptr)
1037 char *dirlist_ptr;
1038{
1039 char *p;
1040
1041 while (1)
1042 {
1043 p = strchr (dirlist_ptr, PATH_SEPARATOR);
1044 if (p != NULL)
1045 *p = '\0';
1046 if (*dirlist_ptr != '\0')
1047 ldfile_add_library_path (dirlist_ptr, true);
1048 if (p == NULL)
1049 break;
1050 dirlist_ptr = p + 1;
1051 }
1052}
1053
1054static void
1055set_section_start (sect, valstr)
1056 char *sect, *valstr;
1057{
93697284
AM
1058 const char *end;
1059 bfd_vma val = bfd_scan_vma (valstr, &end, 16);
252b5132
RH
1060 if (*end)
1061 einfo (_("%P%F: invalid hex number `%s'\n"), valstr);
1062 lang_section_start (sect, exp_intop (val));
1063}
1064\f
1065/* Print help messages for the options. */
1066
1067static void
1068help ()
1069{
1070 int i;
1071 const char **targets, **pp;
1072
1073 printf (_("Usage: %s [options] file...\n"), program_name);
1074
1075 printf (_("Options:\n"));
1076 for (i = 0; i < OPTION_COUNT; i++)
1077 {
1078 if (ld_options[i].doc != NULL)
1079 {
1080 boolean comma;
1081 int len;
1082 int j;
1083
1084 printf (" ");
1085
1086 comma = false;
1087 len = 2;
1088
1089 j = i;
1090 do
1091 {
1092 if (ld_options[j].shortopt != '\0'
1093 && ld_options[j].control != NO_HELP)
1094 {
1095 printf ("%s-%c", comma ? ", " : "", ld_options[j].shortopt);
1096 len += (comma ? 2 : 0) + 2;
1097 if (ld_options[j].arg != NULL)
1098 {
1099 if (ld_options[j].opt.has_arg != optional_argument)
1100 {
1101 printf (" ");
1102 ++len;
1103 }
1104 printf ("%s", _(ld_options[j].arg));
1105 len += strlen (_(ld_options[j].arg));
1106 }
1107 comma = true;
1108 }
1109 ++j;
1110 }
1111 while (j < OPTION_COUNT && ld_options[j].doc == NULL);
1112
1113 j = i;
1114 do
1115 {
1116 if (ld_options[j].opt.name != NULL
1117 && ld_options[j].control != NO_HELP)
1118 {
1119 printf ("%s-%s%s",
1120 comma ? ", " : "",
1121 ld_options[j].control == TWO_DASHES ? "-" : "",
1122 ld_options[j].opt.name);
1123 len += ((comma ? 2 : 0)
1124 + 1
1125 + (ld_options[j].control == TWO_DASHES ? 1 : 0)
1126 + strlen (ld_options[j].opt.name));
1127 if (ld_options[j].arg != NULL)
1128 {
1129 printf (" %s", _(ld_options[j].arg));
1130 len += 1 + strlen (_(ld_options[j].arg));
1131 }
1132 comma = true;
1133 }
1134 ++j;
1135 }
1136 while (j < OPTION_COUNT && ld_options[j].doc == NULL);
1137
1138 if (len >= 30)
1139 {
1140 printf ("\n");
1141 len = 0;
1142 }
1143
1144 for (; len < 30; len++)
1145 putchar (' ');
1146
1147 printf ("%s\n", _(ld_options[i].doc));
1148 }
1149 }
1150
f75692fe
NC
1151 /* Note: Various tools (such as libtool) depend upon the
1152 format of the listings below - do not change them. */
252b5132 1153 /* xgettext:c-format */
f75692fe 1154 printf (_("%s: supported targets:"), program_name);
252b5132
RH
1155 targets = bfd_target_list ();
1156 for (pp = targets; *pp != NULL; pp++)
1157 printf (" %s", *pp);
1158 free (targets);
1159 printf ("\n");
1160
1161 /* xgettext:c-format */
f75692fe 1162 printf (_("%s: supported emulations: "), program_name);
252b5132
RH
1163 ldemul_list_emulations (stdout);
1164 printf ("\n");
1165
1166 /* xgettext:c-format */
1167 printf (_("%s: emulation specific options:\n"), program_name);
1168 ldemul_list_emulation_options (stdout);
1169 printf ("\n");
c20f4f8c 1170
8ad3436c 1171 printf (_("Report bugs to %s\n"), REPORT_BUGS_TO);
252b5132 1172}