* ld-srec/srec.exp: Don't use [] in setup_xfail expressions.
[deliverable/binutils-gdb.git] / ld / lexsup.c
CommitLineData
d4e5e3c3 1/* Parse options for the GNU linker.
80fd1f45 2 Copyright (C) 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
d4e5e3c3
DM
3
4This file is part of GLD, the Gnu Linker.
5
6GLD is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GLD is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GLD; see the file COPYING. If not, write to
943fbd5b 18the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
d4e5e3c3
DM
19
20#include "bfd.h"
21#include "sysdep.h"
22#include <stdio.h>
23#include <string.h>
22d3533c 24#include <ctype.h>
d4e5e3c3
DM
25#include "getopt.h"
26#include "bfdlink.h"
d4e5e3c3
DM
27#include "ld.h"
28#include "ldmain.h"
29#include "ldmisc.h"
30#include "ldexp.h"
31#include "ldlang.h"
32#include "ldgram.h"
33#include "ldlex.h"
34#include "ldfile.h"
4725fb48 35#include "ldver.h"
5753006b 36#include "ldemul.h"
d4e5e3c3 37
809ee7e0
ILT
38/* Somewhere above, sys/stat.h got included . . . . */
39#if !defined(S_ISDIR) && defined(S_IFDIR)
40#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
41#endif
42
d4e5e3c3
DM
43/* Omit args to avoid the possibility of clashing with a system header
44 that might disagree about consts. */
45unsigned long strtoul ();
46
47static void set_default_dirlist PARAMS ((char *dirlist_ptr));
48static void set_section_start PARAMS ((char *sect, char *valstr));
49
630f4ac9
ILT
50/* Non-zero if we are processing a --defsym from the command line. */
51int parsing_defsym = 0;
de71eb77 52
d4e5e3c3
DM
53void
54parse_args (argc, argv)
55 int argc;
56 char **argv;
57{
22d3533c 58 int i;
db770dfa 59 int ingroup = 0;
5753006b 60 char *default_dirlist = NULL;
db770dfa 61
d4e5e3c3
DM
62 /* Starting the short option string with '-' is for programs that
63 expect options and other ARGV-elements in any order and that care about
64 the ordering of the two. We describe each non-option ARGV-element
65 as if it were the argument of an option with character code 1. */
66
db770dfa 67 const char *shortopts =
80fd1f45 68 "-a:A:B::b:c:de:F::G:gh:iL:l:Mm:NnO:o:R:rSsT:tu:VvXxY:y:z:()";
d4e5e3c3 69
d5b79a89
DM
70 /* 150 isn't special; it's just an arbitrary non-ASCII char value. */
71
5753006b
ILT
72#define OPTION_ASSERT 150
73#define OPTION_CALL_SHARED (OPTION_ASSERT + 1)
bec7a138 74#define OPTION_DEFSYM (OPTION_CALL_SHARED + 1)
7fb9ca5f
ILT
75#define OPTION_DYNAMIC_LINKER (OPTION_DEFSYM + 1)
76#define OPTION_EB (OPTION_DYNAMIC_LINKER + 1)
bec7a138 77#define OPTION_EL (OPTION_EB + 1)
5753006b 78#define OPTION_EMBEDDED_RELOCS (OPTION_EL + 1)
de71eb77
SC
79#define OPTION_EXPORT_DYNAMIC (OPTION_EMBEDDED_RELOCS + 1)
80#define OPTION_HELP (OPTION_EXPORT_DYNAMIC + 1)
bec7a138
ILT
81#define OPTION_IGNORE (OPTION_HELP + 1)
82#define OPTION_MAP (OPTION_IGNORE + 1)
83#define OPTION_NO_KEEP_MEMORY (OPTION_MAP + 1)
84#define OPTION_NOINHIBIT_EXEC (OPTION_NO_KEEP_MEMORY + 1)
85#define OPTION_NON_SHARED (OPTION_NOINHIBIT_EXEC + 1)
86#define OPTION_OFORMAT (OPTION_NON_SHARED + 1)
87#define OPTION_RELAX (OPTION_OFORMAT + 1)
88#define OPTION_RETAIN_SYMBOLS_FILE (OPTION_RELAX + 1)
809ee7e0
ILT
89#define OPTION_RPATH (OPTION_RETAIN_SYMBOLS_FILE + 1)
90#define OPTION_SHARED (OPTION_RPATH + 1)
91#define OPTION_SONAME (OPTION_SHARED + 1)
92#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
229ba4b3
SC
93#define OPTION_STATS (OPTION_SORT_COMMON + 1)
94#define OPTION_SYMBOLIC (OPTION_STATS + 1)
4551e108 95#define OPTION_TBSS (OPTION_SYMBOLIC + 1)
bec7a138
ILT
96#define OPTION_TDATA (OPTION_TBSS + 1)
97#define OPTION_TTEXT (OPTION_TDATA + 1)
98#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
99#define OPTION_UR (OPTION_TRADITIONAL_FORMAT + 1)
de71eb77
SC
100#define OPTION_VERBOSE (OPTION_UR + 1)
101#define OPTION_VERSION (OPTION_VERBOSE + 1)
bec7a138 102#define OPTION_WARN_COMMON (OPTION_VERSION + 1)
80fd1f45
ILT
103#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
104#define OPTION_WARN_ONCE (OPTION_WARN_CONSTRUCTORS + 1)
de71eb77
SC
105#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_ONCE + 1)
106#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
107#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
229ba4b3 108
229ba4b3 109
d5b79a89 110 static struct option longopts[] = {
229ba4b3 111 /* Sorted alphabeticaly, except for the PE options grouped at the end. */
5753006b 112 {"assert", required_argument, NULL, OPTION_ASSERT},
db770dfa
ILT
113 {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
114 {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
4551e108 115 {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
d5b79a89 116 {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
d4e5e3c3 117 {"dc", no_argument, NULL, 'd'},
d5b79a89 118 {"defsym", required_argument, NULL, OPTION_DEFSYM},
809ee7e0 119 {"dll-verbose", no_argument, NULL, OPTION_VERSION}, /* Linux. */
2a9fa50c 120 {"dn", no_argument, NULL, OPTION_NON_SHARED},
d4e5e3c3 121 {"dp", no_argument, NULL, 'd'},
2a9fa50c 122 {"dy", no_argument, NULL, OPTION_CALL_SHARED},
7fb9ca5f 123 {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
d5b79a89 124 {"EB", no_argument, NULL, OPTION_EB},
d5b79a89 125 {"EL", no_argument, NULL, OPTION_EL},
de71eb77 126 {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
db770dfa 127 {"end-group", no_argument, NULL, ')'},
de71eb77 128 {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC},
d4e5e3c3 129 {"format", required_argument, NULL, 'b'},
d5b79a89 130 {"help", no_argument, NULL, OPTION_HELP},
d5b79a89 131 {"Map", required_argument, NULL, OPTION_MAP},
d5b79a89 132 {"no-keep-memory", no_argument, NULL, OPTION_NO_KEEP_MEMORY},
d5b79a89
DM
133 {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
134 {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
2a9fa50c 135 {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
d5b79a89 136 {"oformat", required_argument, NULL, OPTION_OFORMAT},
2a9fa50c 137 {"Qy", no_argument, NULL, OPTION_IGNORE},
cbbf9608 138 {"qmagic", no_argument, NULL, OPTION_IGNORE}, /* Linux compatibility. */
d5b79a89 139 {"relax", no_argument, NULL, OPTION_RELAX},
db770dfa 140 {"retain-symbols-file", required_argument, NULL, OPTION_RETAIN_SYMBOLS_FILE},
809ee7e0 141 {"rpath", required_argument, NULL, OPTION_RPATH},
db770dfa 142 {"shared", no_argument, NULL, OPTION_SHARED},
809ee7e0 143 {"soname", required_argument, NULL, OPTION_SONAME},
d5b79a89
DM
144 {"sort-common", no_argument, NULL, OPTION_SORT_COMMON},
145 {"sort_common", no_argument, NULL, OPTION_SORT_COMMON},
db770dfa 146 {"start-group", no_argument, NULL, '('},
d5b79a89 147 {"stats", no_argument, NULL, OPTION_STATS},
42792411 148 {"static", no_argument, NULL, OPTION_NON_SHARED},
d5b79a89 149 {"Tbss", required_argument, NULL, OPTION_TBSS},
d5b79a89 150 {"Tdata", required_argument, NULL, OPTION_TDATA},
d5b79a89 151 {"Ttext", required_argument, NULL, OPTION_TTEXT},
c96386c4 152 {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
d5b79a89 153 {"Ur", no_argument, NULL, OPTION_UR},
de71eb77 154 {"verbose", no_argument, NULL, OPTION_VERBOSE},
d5b79a89 155 {"version", no_argument, NULL, OPTION_VERSION},
d5b79a89 156 {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
80fd1f45 157 {"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
809ee7e0 158 {"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
de71eb77
SC
159 {"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
160 {"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
161 {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
229ba4b3 162
229ba4b3 163
d4e5e3c3
DM
164 {NULL, no_argument, NULL, 0}
165 };
166
22d3533c
ILT
167 /* The -G option is ambiguous on different platforms. Sometimes it
168 specifies the largest data size to put into the small data
169 section. Sometimes it is equivalent to --shared. Unfortunately,
170 the first form takes an argument, while the second does not.
171
172 We need to permit the --shared form because on some platforms,
173 such as Solaris, gcc -shared will pass -G to the linker.
174
175 To permit either usage, we look through the argument list. If we
176 find -G not followed by a number, we change it into --shared.
177 This will work for most normal cases. */
178 for (i = 1; i < argc; i++)
179 if (strcmp (argv[i], "-G") == 0
180 && (i + 1 >= argc
181 || ! isdigit (argv[i + 1][0])))
182 argv[i] = (char *) "--shared";
183
d4e5e3c3
DM
184 while (1)
185 {
186 /* getopt_long_only is like getopt_long, but '-' as well as '--' can
187 indicate a long option. */
d5b79a89 188 int longind;
5753006b
ILT
189 int optc;
190
191 if (ldemul_parse_args (argc, argv))
192 continue;
193
194 optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
d5b79a89 195
d4e5e3c3
DM
196 if (optc == -1)
197 break;
d4e5e3c3
DM
198 switch (optc)
199 {
200 default:
201 xexit (1);
202 case 1: /* File name. */
203 lang_add_input_file (optarg, lang_input_file_is_file_enum,
204 (char *) NULL);
205 break;
206
2a9fa50c
ILT
207 case OPTION_IGNORE:
208 break;
de71eb77
SC
209 case 'a':
210 /* For HP/UX compatibility. Actually -a shared should mean
211 ``use only shared libraries'' but, then, we don't
212 currently support shared libraries on HP/UX anyhow. */
213 if (strcmp (optarg, "archive") == 0)
214 config.dynamic_link = false;
215 else if (strcmp (optarg, "shared") == 0
216 || strcmp (optarg, "default") == 0)
217 config.dynamic_link = true;
218 else
219 einfo ("%P%F: unrecognized -a option `%s'\n", optarg);
220 break;
5753006b
ILT
221 case OPTION_ASSERT:
222 /* FIXME: We just ignore these, except for pure-text, but we
223 should handle them. */
224 if (strcmp (optarg, "definitions") == 0)
225 ;
226 else if (strcmp (optarg, "nodefinitions") == 0)
227 ;
228 else if (strcmp (optarg, "nosymbolic") == 0)
229 ;
230 else if (strcmp (optarg, "pure-text") == 0)
231 {
232 /* FIXME: This is wrong. We do it this way as a hack to
233 support SunOS4, on which gcc -shared will pass
234 -assert pure-text to the linker. The SunOS linker
235 will automatically create a shared library if there
236 are any undefined symbols, but our linker does not
237 know how to do that (it seems to require an extra
238 pass over the relocs). */
239 link_info.shared = true;
240 }
241 else
242 einfo ("%P%F: unrecognized -assert option `%s'\n", optarg);
243 break;
d4e5e3c3
DM
244 case 'A':
245 ldfile_add_arch (optarg);
246 break;
d4e5e3c3
DM
247 case 'b':
248 lang_add_target (optarg);
249 break;
250 case 'c':
251 ldfile_open_command_file (optarg);
252 parser_input = input_mri_script;
253 yyparse ();
254 break;
d5b79a89 255 case OPTION_CALL_SHARED:
2a9fa50c
ILT
256 config.dynamic_link = true;
257 break;
258 case OPTION_NON_SHARED:
259 config.dynamic_link = false;
d4e5e3c3
DM
260 break;
261 case 'd':
262 command_line.force_common_definition = true;
263 break;
d5b79a89 264 case OPTION_DEFSYM:
630f4ac9 265 lex_string = optarg;
d4e5e3c3
DM
266 lex_redirect (optarg);
267 parser_input = input_defsym;
630f4ac9 268 parsing_defsym = 1;
d4e5e3c3 269 yyparse ();
630f4ac9
ILT
270 parsing_defsym = 0;
271 lex_string = NULL;
d4e5e3c3 272 break;
7fb9ca5f
ILT
273 case OPTION_DYNAMIC_LINKER:
274 command_line.interpreter = optarg;
275 break;
d5b79a89 276 case OPTION_EB:
86037281 277 command_line.endian = ENDIAN_BIG;
d4e5e3c3 278 break;
d5b79a89 279 case OPTION_EL:
86037281 280 command_line.endian = ENDIAN_LITTLE;
d4e5e3c3 281 break;
de71eb77
SC
282 case OPTION_EMBEDDED_RELOCS:
283 command_line.embedded_relocs = true;
284 break;
285 case OPTION_EXPORT_DYNAMIC:
286 command_line.export_dynamic = true;
287 break;
d4e5e3c3 288 case 'e':
60e8a534 289 lang_add_entry (optarg, 1);
d4e5e3c3
DM
290 break;
291 case 'F':
292 /* Ignore. */
293 break;
294 case 'G':
295 {
296 char *end;
297 g_switch_value = strtoul (optarg, &end, 0);
298 if (*end)
9d3898b2 299 einfo ("%P%F: invalid number `%s'\n", optarg);
d4e5e3c3
DM
300 }
301 break;
302 case 'g':
303 /* Ignore. */
304 break;
d5b79a89 305 case OPTION_HELP:
d4e5e3c3
DM
306 help ();
307 xexit (0);
308 break;
309 case 'L':
0cd82d00 310 ldfile_add_library_path (optarg, true);
d4e5e3c3
DM
311 break;
312 case 'l':
313 lang_add_input_file (optarg, lang_input_file_is_l_enum,
314 (char *) NULL);
315 break;
316 case 'M':
317 config.map_filename = "-";
318 break;
319 case 'm':
320 /* Ignore. Was handled in a pre-parse. */
321 break;
d5b79a89 322 case OPTION_MAP:
d4e5e3c3
DM
323 config.map_filename = optarg;
324 break;
325 case 'N':
326 config.text_read_only = false;
327 config.magic_demand_paged = false;
328 break;
329 case 'n':
330 config.magic_demand_paged = false;
331 break;
d5b79a89 332 case OPTION_NO_KEEP_MEMORY:
d4e5e3c3
DM
333 link_info.keep_memory = false;
334 break;
d5b79a89 335 case OPTION_NOINHIBIT_EXEC:
d4e5e3c3
DM
336 force_make_executable = true;
337 break;
338 case 'O':
339 /* FIXME "-O<non-digits> <value>" used to set the address of
340 section <non-digits>. Was this for compatibility with
341 something, or can we create a new option to do that
342 (with a syntax similar to -defsym)?
343 getopt can't handle two args to an option without kludges. */
d4e5e3c3
DM
344 break;
345 case 'o':
346 lang_add_output (optarg, 0);
347 break;
d5b79a89 348 case OPTION_OFORMAT:
86037281 349 lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
d4e5e3c3 350 break;
3e1fd33d 351 case 'i':
d4e5e3c3
DM
352 case 'r':
353 link_info.relocateable = true;
354 config.build_constructors = false;
355 config.magic_demand_paged = false;
356 config.text_read_only = false;
2a9fa50c 357 config.dynamic_link = false;
d4e5e3c3
DM
358 break;
359 case 'R':
809ee7e0
ILT
360 /* The GNU linker traditionally uses -R to mean to include
361 only the symbols from a file. The Solaris linker uses -R
362 to set the path used by the runtime linker to find
363 libraries. This is the GNU linker -rpath argument. We
364 try to support both simultaneously by checking the file
365 named. If it is a directory, rather than a regular file,
366 we assume -rpath was meant. */
367 {
368 struct stat s;
369
370 if (stat (optarg, &s) >= 0
371 && ! S_ISDIR (s.st_mode))
372 {
373 lang_add_input_file (optarg,
374 lang_input_file_is_symbols_only_enum,
375 (char *) NULL);
376 break;
377 }
378 }
379 /* Fall through. */
380 case OPTION_RPATH:
381 if (command_line.rpath == NULL)
382 command_line.rpath = buystring (optarg);
383 else
384 {
385 char *buf;
386
387 buf = xmalloc (strlen (command_line.rpath)
388 + strlen (optarg)
389 + 2);
390 sprintf (buf, "%s:%s", command_line.rpath, optarg);
391 free (command_line.rpath);
392 command_line.rpath = buf;
393 }
d4e5e3c3 394 break;
d5b79a89 395 case OPTION_RELAX:
d4e5e3c3
DM
396 command_line.relax = true;
397 break;
d5b79a89 398 case OPTION_RETAIN_SYMBOLS_FILE:
d4e5e3c3
DM
399 add_keepsyms_file (optarg);
400 break;
401 case 'S':
402 link_info.strip = strip_debugger;
403 break;
404 case 's':
405 link_info.strip = strip_all;
406 break;
db770dfa
ILT
407 case OPTION_SHARED:
408 link_info.shared = true;
409 break;
5753006b 410 case 'h': /* Used on Solaris. */
809ee7e0
ILT
411 case OPTION_SONAME:
412 command_line.soname = optarg;
413 break;
d5b79a89 414 case OPTION_SORT_COMMON:
d4e5e3c3
DM
415 config.sort_common = true;
416 break;
d5b79a89 417 case OPTION_STATS:
d4e5e3c3
DM
418 config.stats = true;
419 break;
4551e108
ILT
420 case OPTION_SYMBOLIC:
421 link_info.symbolic = true;
422 break;
d4e5e3c3
DM
423 case 't':
424 trace_files = true;
425 break;
426 case 'T':
427 ldfile_open_command_file (optarg);
428 parser_input = input_script;
429 yyparse ();
430 break;
d5b79a89 431 case OPTION_TBSS:
d4e5e3c3
DM
432 set_section_start (".bss", optarg);
433 break;
d5b79a89 434 case OPTION_TDATA:
d4e5e3c3
DM
435 set_section_start (".data", optarg);
436 break;
d5b79a89 437 case OPTION_TTEXT:
d4e5e3c3
DM
438 set_section_start (".text", optarg);
439 break;
c96386c4
ILT
440 case OPTION_TRADITIONAL_FORMAT:
441 config.traditional_format = true;
442 break;
d5b79a89 443 case OPTION_UR:
d4e5e3c3
DM
444 link_info.relocateable = true;
445 config.build_constructors = true;
446 config.magic_demand_paged = false;
447 config.text_read_only = false;
2a9fa50c 448 config.dynamic_link = false;
d4e5e3c3
DM
449 break;
450 case 'u':
451 ldlang_add_undef (optarg);
452 break;
de71eb77 453 case OPTION_VERBOSE:
d4e5e3c3
DM
454 ldversion (1);
455 version_printed = true;
456 trace_file_tries = true;
457 break;
458 case 'v':
459 ldversion (0);
460 version_printed = true;
461 break;
de71eb77
SC
462 case 'V':
463 ldversion (1);
464 version_printed = true;
465 break;
d5b79a89 466 case OPTION_VERSION:
d4e5e3c3
DM
467 ldversion (0);
468 version_printed = true;
469 break;
d5b79a89 470 case OPTION_WARN_COMMON:
d4e5e3c3
DM
471 config.warn_common = true;
472 break;
80fd1f45
ILT
473 case OPTION_WARN_CONSTRUCTORS:
474 config.warn_constructors = true;
475 break;
809ee7e0
ILT
476 case OPTION_WARN_ONCE:
477 config.warn_once = true;
478 break;
de71eb77
SC
479 case OPTION_WHOLE_ARCHIVE:
480 whole_archive = true;
481 break;
d4e5e3c3
DM
482 case 'X':
483 link_info.discard = discard_l;
484 break;
485 case 'x':
486 link_info.discard = discard_all;
487 break;
d5b79a89 488 case 'Y':
5753006b
ILT
489 if (strncmp (optarg, "P,", 2) == 0)
490 optarg += 2;
491 default_dirlist = optarg;
d5b79a89 492 break;
d4e5e3c3
DM
493 case 'y':
494 add_ysym (optarg);
495 break;
22d3533c
ILT
496 case 'z':
497 /* We accept and ignore this option for Solaris
498 compatibility. Actually, on Solaris, optarg is not
499 ignored. Someday we should handle it correctly. FIXME. */
500 break;
de71eb77
SC
501 case OPTION_SPLIT_BY_RELOC:
502 config.split_by_reloc = atoi (optarg);
503 break;
504 case OPTION_SPLIT_BY_FILE:
505 config.split_by_file = true;
506 break;
db770dfa
ILT
507 case '(':
508 if (ingroup)
509 {
510 fprintf (stderr,
511 "%s: may not nest groups (--help for usage)\n",
512 program_name);
513 xexit (1);
514 }
515 lang_enter_group ();
516 ingroup = 1;
517 break;
518 case ')':
519 if (! ingroup)
520 {
521 fprintf (stderr,
522 "%s: group ended before it began (--help for usage)\n",
523 program_name);
524 xexit (1);
525 }
526 lang_leave_group ();
527 ingroup = 0;
528 break;
229ba4b3 529
d4e5e3c3
DM
530 }
531 }
db770dfa
ILT
532
533 if (ingroup)
534 lang_leave_group ();
5753006b
ILT
535
536 if (default_dirlist != NULL)
537 set_default_dirlist (default_dirlist);
538
d4e5e3c3
DM
539}
540
541/* Add the (colon-separated) elements of DIRLIST_PTR to the
542 library search path. */
543
544static void
545set_default_dirlist (dirlist_ptr)
546 char *dirlist_ptr;
547{
548 char *p;
549
550 while (1)
551 {
552 p = strchr (dirlist_ptr, ':');
553 if (p != NULL)
554 *p = 0;
555 if (*dirlist_ptr)
0cd82d00 556 ldfile_add_library_path (dirlist_ptr, true);
d4e5e3c3
DM
557 if (p == NULL)
558 break;
559 *p = ':';
560 dirlist_ptr = p + 1;
561 }
562}
563
564static void
565set_section_start (sect, valstr)
566 char *sect, *valstr;
567{
568 char *end;
569 unsigned long val = strtoul (valstr, &end, 16);
570 if (*end)
d5b79a89 571 einfo ("%P%F: invalid hex number `%s'\n", valstr);
d4e5e3c3
DM
572 lang_section_start (sect, exp_intop (val));
573}
229ba4b3 574\f
This page took 0.09798 seconds and 4 git commands to generate.