* Makefile.in: Format variable definitions consistently.
[deliverable/binutils-gdb.git] / ld / ldmain.c
1 /* Main program of GNU linker.
2 Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
3 Written by Steve Chamberlain steve@cygnus.com
4
5 This file is part of GLD, the Gnu Linker.
6
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)
10 any later version.
11
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.
16
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
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21
22 #include "bfd.h"
23 #include "sysdep.h"
24 #include <stdio.h>
25 #include "bfdlink.h"
26
27 #include "config.h"
28 #include "ld.h"
29 #include "ldmain.h"
30 #include "ldmisc.h"
31 #include "ldwrite.h"
32 #include "ldgram.h"
33 #include "ldexp.h"
34 #include "ldlang.h"
35 #include "ldemul.h"
36 #include "ldlex.h"
37 #include "ldfile.h"
38 #include "ldctor.h"
39
40 /* Somewhere above, sys/stat.h got included . . . . */
41 #if !defined(S_ISDIR) && defined(S_IFDIR)
42 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
43 #endif
44
45 #include <string.h>
46
47 static char *get_emulation PARAMS ((int, char **));
48 static void set_scripts_dir PARAMS ((void));
49
50 /* EXPORTS */
51
52 char *default_target;
53 const char *output_filename = "a.out";
54
55 /* Name this program was invoked by. */
56 char *program_name;
57
58 /* The file that we're creating */
59 bfd *output_bfd = 0;
60
61 /* Set by -G argument, for MIPS ECOFF target. */
62 int g_switch_value = 8;
63
64 /* Nonzero means print names of input files as processed. */
65 boolean trace_files;
66
67 /* Nonzero means same, but note open failures, too. */
68 boolean trace_file_tries;
69
70 /* 1 => write load map. */
71 boolean write_map;
72
73 args_type command_line;
74
75 ld_config_type config;
76
77 static boolean check_for_scripts_dir PARAMS ((char *dir));
78 static boolean add_archive_element PARAMS ((struct bfd_link_info *, bfd *,
79 const char *));
80 static boolean multiple_definition PARAMS ((struct bfd_link_info *,
81 const char *,
82 bfd *, asection *, bfd_vma,
83 bfd *, asection *, bfd_vma));
84 static boolean multiple_common PARAMS ((struct bfd_link_info *,
85 const char *, bfd *,
86 enum bfd_link_hash_type, bfd_vma,
87 bfd *, enum bfd_link_hash_type,
88 bfd_vma));
89 static boolean add_to_set PARAMS ((struct bfd_link_info *,
90 struct bfd_link_hash_entry *,
91 unsigned int bitsize,
92 bfd *, asection *, bfd_vma));
93 static boolean constructor_callback PARAMS ((struct bfd_link_info *,
94 boolean constructor,
95 unsigned int bitsize,
96 const char *name,
97 bfd *, asection *, bfd_vma));
98 static boolean warning_callback PARAMS ((struct bfd_link_info *,
99 const char *));
100 static boolean undefined_symbol PARAMS ((struct bfd_link_info *,
101 const char *, bfd *,
102 asection *, bfd_vma));
103 static boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *,
104 const char *, bfd_vma,
105 bfd *, asection *, bfd_vma));
106 static boolean reloc_dangerous PARAMS ((struct bfd_link_info *, const char *,
107 bfd *, asection *, bfd_vma));
108 static boolean unattached_reloc PARAMS ((struct bfd_link_info *,
109 const char *, bfd *, asection *,
110 bfd_vma));
111 static boolean notice_ysym PARAMS ((struct bfd_link_info *, const char *,
112 bfd *, asection *, bfd_vma));
113
114 static struct bfd_link_callbacks link_callbacks =
115 {
116 add_archive_element,
117 multiple_definition,
118 multiple_common,
119 add_to_set,
120 constructor_callback,
121 warning_callback,
122 undefined_symbol,
123 reloc_overflow,
124 reloc_dangerous,
125 unattached_reloc,
126 notice_ysym
127 };
128
129 struct bfd_link_info link_info;
130 \f
131 extern int main PARAMS ((int, char **));
132
133 int
134 main (argc, argv)
135 int argc;
136 char **argv;
137 {
138 char *emulation;
139 long start_time = get_run_time ();
140
141 program_name = argv[0];
142
143 bfd_init ();
144
145 /* Initialize the data about options. */
146 trace_files = trace_file_tries = false;
147 write_map = false;
148 config.build_constructors = true;
149 command_line.force_common_definition = false;
150
151 link_info.callbacks = &link_callbacks;
152 link_info.relocateable = false;
153 link_info.strip = strip_none;
154 link_info.discard = discard_none;
155 link_info.lprefix_len = 1;
156 link_info.lprefix = "L";
157 link_info.keep_memory = true;
158 link_info.input_bfds = NULL;
159 link_info.create_object_symbols_section = NULL;
160 link_info.hash = NULL;
161 link_info.keep_hash = NULL;
162 link_info.notice_hash = NULL;
163
164 ldfile_add_arch ("");
165
166 config.make_executable = true;
167 force_make_executable = false;
168 config.magic_demand_paged = true;
169 config.text_read_only = true;
170 config.make_executable = true;
171
172 emulation = get_emulation (argc, argv);
173 ldemul_choose_mode (emulation);
174 default_target = ldemul_choose_target ();
175 lang_init ();
176 ldemul_before_parse ();
177 lang_has_input_file = false;
178 parse_args (argc, argv);
179
180 /* This essentially adds another -L directory so this must be done after
181 the -L's in argv have been processed. */
182 set_scripts_dir ();
183
184 if (had_script == false)
185 {
186 /* Read the emulation's appropriate default script. */
187 int isfile;
188 char *s = ldemul_get_script (&isfile);
189
190 if (isfile)
191 {
192 /* sizeof counts the terminating NUL. */
193 size_t size = strlen (s) + sizeof ("-T ");
194 char *buf = (char *) ldmalloc(size);
195 sprintf (buf, "-T %s", s);
196 parse_line (buf, 0);
197 free (buf);
198 }
199 else
200 parse_line (s, 1);
201 }
202
203 if (link_info.relocateable && command_line.relax)
204 {
205 einfo ("%P%F: -relax and -r may not be used together\n");
206 }
207 lang_final ();
208
209 if (lang_has_input_file == false)
210 {
211 einfo ("%P%F: no input files\n");
212 }
213
214 if (trace_files)
215 {
216 info_msg ("%P: mode %s\n", emulation);
217 }
218
219 ldemul_after_parse ();
220
221
222 if (config.map_filename)
223 {
224 if (strcmp (config.map_filename, "-") == 0)
225 {
226 config.map_file = stdout;
227 }
228 else
229 {
230 config.map_file = fopen (config.map_filename, FOPEN_WT);
231 if (config.map_file == (FILE *) NULL)
232 {
233 einfo ("%P%F: cannot open map file %s: %E\n",
234 config.map_filename);
235 }
236 }
237 }
238
239
240 lang_process ();
241
242 /* Print error messages for any missing symbols, for any warning
243 symbols, and possibly multiple definitions */
244
245
246 if (config.text_read_only)
247 {
248 /* Look for a text section and mark the readonly attribute in it */
249 asection *found = bfd_get_section_by_name (output_bfd, ".text");
250
251 if (found != (asection *) NULL)
252 {
253 found->flags |= SEC_READONLY;
254 }
255 }
256
257 if (link_info.relocateable)
258 output_bfd->flags &= ~EXEC_P;
259 else
260 output_bfd->flags |= EXEC_P;
261
262 ldwrite ();
263
264 /* Even if we're producing relocateable output, some non-fatal errors should
265 be reported in the exit status. (What non-fatal errors, if any, do we
266 want to ignore for relocateable output?) */
267
268 if (config.make_executable == false && force_make_executable == false)
269 {
270 if (trace_files == true)
271 {
272 einfo ("%P: link errors found, deleting executable `%s'\n",
273 output_filename);
274 }
275
276 if (output_bfd->iostream)
277 fclose ((FILE *) (output_bfd->iostream));
278
279 unlink (output_filename);
280 exit (1);
281 }
282 else
283 {
284 bfd_close (output_bfd);
285 }
286
287 if (config.stats)
288 {
289 extern char **environ;
290 char *lim = (char *) sbrk (0);
291 long run_time = get_run_time () - start_time;
292
293 fprintf (stderr, "%s: total time in link: %d.%06d\n",
294 program_name, run_time / 1000000, run_time % 1000000);
295 fprintf (stderr, "%s: data size %ld\n", program_name,
296 (long) (lim - (char *) &environ));
297 }
298
299 exit (0);
300 return 0;
301 }
302
303 /* We need to find any explicitly given emulation in order to initialize the
304 state that's needed by the lex&yacc argument parser (parse_args). */
305
306 static char *
307 get_emulation (argc, argv)
308 int argc;
309 char **argv;
310 {
311 char *emulation;
312 int i;
313
314 emulation = (char *) getenv (EMULATION_ENVIRON);
315 if (emulation == NULL)
316 emulation = DEFAULT_EMULATION;
317
318 for (i = 1; i < argc; i++)
319 {
320 if (!strncmp (argv[i], "-m", 2))
321 {
322 if (argv[i][2] == '\0')
323 {
324 /* -m EMUL */
325 if (i < argc - 1)
326 {
327 emulation = argv[i + 1];
328 i++;
329 }
330 else
331 {
332 einfo("%P%F: missing argument to -m\n");
333 }
334 }
335 else if (strcmp (argv[i], "-mips1") == 0
336 || strcmp (argv[i], "-mips2") == 0
337 || strcmp (argv[i], "-mips3") == 0)
338 {
339 /* FIXME: The arguments -mips1, -mips2 and -mips3 are
340 passed to the linker by some MIPS compilers. They
341 generally tell the linker to use a slightly different
342 library path. Perhaps someday these should be
343 implemented as emulations; until then, we just ignore
344 the arguments and hope that nobody ever creates
345 emulations named ips1, ips2 or ips3. */
346 }
347 else
348 {
349 /* -mEMUL */
350 emulation = &argv[i][2];
351 }
352 }
353 }
354
355 return emulation;
356 }
357
358 /* If directory DIR contains an "ldscripts" subdirectory,
359 add DIR to the library search path and return true,
360 else return false. */
361
362 static boolean
363 check_for_scripts_dir (dir)
364 char *dir;
365 {
366 size_t dirlen;
367 char *buf;
368 struct stat s;
369 boolean res;
370
371 dirlen = strlen (dir);
372 /* sizeof counts the terminating NUL. */
373 buf = (char *) ldmalloc (dirlen + sizeof("/ldscripts"));
374 sprintf (buf, "%s/ldscripts", dir);
375
376 res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
377 free (buf);
378 if (res)
379 ldfile_add_library_path (dir);
380 return res;
381 }
382
383 /* Set the default directory for finding script files.
384 Libraries will be searched for here too, but that's ok.
385 We look for the "ldscripts" directory in:
386
387 SCRIPTDIR (passed from Makefile)
388 the dir where this program is (for using it from the build tree)
389 the dir where this program is/../lib (for installing the tool suite elsewhere) */
390
391 static void
392 set_scripts_dir ()
393 {
394 char *end, *dir;
395 size_t dirlen;
396
397 if (check_for_scripts_dir (SCRIPTDIR))
398 return; /* We've been installed normally. */
399
400 /* Look for "ldscripts" in the dir where our binary is. */
401 end = strrchr (program_name, '/');
402 if (end)
403 {
404 dirlen = end - program_name;
405 /* Make a copy of program_name in dir.
406 Leave room for later "/../lib". */
407 dir = (char *) ldmalloc (dirlen + 8);
408 strncpy (dir, program_name, dirlen);
409 dir[dirlen] = '\0';
410 }
411 else
412 {
413 dirlen = 1;
414 dir = (char *) ldmalloc (dirlen + 8);
415 strcpy (dir, ".");
416 }
417
418 if (check_for_scripts_dir (dir))
419 return; /* Don't free dir. */
420
421 /* Look for "ldscripts" in <the dir where our binary is>/../lib. */
422 strcpy (dir + dirlen, "/../lib");
423 if (check_for_scripts_dir (dir))
424 return;
425
426 free (dir); /* Well, we tried. */
427 }
428
429 void
430 add_ysym (name)
431 const char *name;
432 {
433 if (link_info.notice_hash == (struct bfd_hash_table *) NULL)
434 {
435 link_info.notice_hash = ((struct bfd_hash_table *)
436 ldmalloc (sizeof (struct bfd_hash_table)));
437 if (! bfd_hash_table_init_n (link_info.notice_hash,
438 bfd_hash_newfunc,
439 61))
440 einfo ("%P%F: bfd_hash_table_init failed: %E\n");
441 }
442
443 if (bfd_hash_lookup (link_info.notice_hash, name, true, true)
444 == (struct bfd_hash_entry *) NULL)
445 einfo ("%P%F: bfd_hash_lookup failed: %E\n");
446 }
447
448 /* Handle the -retain-symbols-file option. */
449
450 void
451 add_keepsyms_file (filename)
452 const char *filename;
453 {
454 FILE *file;
455 char *buf;
456 size_t bufsize;
457 int c;
458
459 if (link_info.strip == strip_some)
460 einfo ("%X%P: error: duplicate retain-symbols-file\n");
461
462 file = fopen (filename, "r");
463 if (file == (FILE *) NULL)
464 {
465 bfd_error = system_call_error;
466 einfo ("%X%P: %s: %E", filename);
467 return;
468 }
469
470 link_info.keep_hash = ((struct bfd_hash_table *)
471 ldmalloc (sizeof (struct bfd_hash_table)));
472 if (! bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc))
473 einfo ("%P%F: bfd_hash_table_init failed: %E\n");
474
475 bufsize = 100;
476 buf = (char *) ldmalloc (bufsize);
477
478 c = getc (file);
479 while (c != EOF)
480 {
481 while (isspace (c))
482 c = getc (file);
483
484 if (c != EOF)
485 {
486 size_t len = 0;
487
488 while (! isspace (c) && c != EOF)
489 {
490 buf[len] = c;
491 ++len;
492 if (len >= bufsize)
493 {
494 bufsize *= 2;
495 buf = ldrealloc (buf, bufsize);
496 }
497 c = getc (file);
498 }
499
500 buf[len] = '\0';
501
502 if (bfd_hash_lookup (link_info.keep_hash, buf, true, true)
503 == (struct bfd_hash_entry *) NULL)
504 einfo ("%P%F: bfd_hash_lookup for insertion failed: %E");
505 }
506 }
507
508 if (link_info.strip != strip_none)
509 einfo ("%P: `-retain-symbols-file' overrides `-s' and `-S'\n");
510
511 link_info.strip = strip_some;
512 }
513 \f
514 /* Callbacks from the BFD linker routines. */
515
516 /* This is called when BFD has decided to include an archive member in
517 a link. */
518
519 /*ARGSUSED*/
520 static boolean
521 add_archive_element (info, abfd, name)
522 struct bfd_link_info *info;
523 bfd *abfd;
524 const char *name;
525 {
526 lang_input_statement_type *input;
527
528 input = ((lang_input_statement_type *)
529 ldmalloc ((bfd_size_type) sizeof (lang_input_statement_type)));
530 input->filename = abfd->filename;
531 input->local_sym_name = abfd->filename;
532 input->the_bfd = abfd;
533 input->asymbols = NULL;
534 input->subfiles = NULL;
535 input->next = NULL;
536 input->just_syms_flag = false;
537 input->loaded = false;
538 input->chain = NULL;
539
540 /* FIXME: This is wrong. It should point to an entry for the
541 archive itself. However, it doesn't seem to matter. */
542 input->superfile = NULL;
543
544 /* FIXME: The following fields are not set: header.next,
545 header.type, closed, passive_position, symbol_count, total_size,
546 next_real_file, is_archive, search_dirs_flag, target, real,
547 common_section, common_output_section, complained. This bit of
548 code is from the old decode_library_subfile function. I don't
549 know whether any of those fields matters. */
550
551 ldlang_add_file (input);
552
553 if (write_map)
554 info_msg ("%s needed due to %T\n", abfd->filename, name);
555
556 if (trace_files || trace_file_tries)
557 info_msg ("%I\n", input);
558
559 return true;
560 }
561
562 /* This is called when BFD has discovered a symbol which is defined
563 multiple times. */
564
565 /*ARGSUSED*/
566 static boolean
567 multiple_definition (info, name, obfd, osec, oval, nbfd, nsec, nval)
568 struct bfd_link_info *info;
569 const char *name;
570 bfd *obfd;
571 asection *osec;
572 bfd_vma oval;
573 bfd *nbfd;
574 asection *nsec;
575 bfd_vma nval;
576 {
577 einfo ("%X%C: multiple definition of `%T'\n",
578 nbfd, nsec, nval, name);
579 if (obfd != (bfd *) NULL)
580 einfo ("%C: first defined here\n", obfd, osec, oval);
581 return true;
582 }
583
584 /* This is called when there is a definition of a common symbol, or
585 when a common symbol is found for a symbol that is already defined,
586 or when two common symbols are found. We only do something if
587 -warn-common was used. */
588
589 /*ARGSUSED*/
590 static boolean
591 multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
592 struct bfd_link_info *info;
593 const char *name;
594 bfd *obfd;
595 enum bfd_link_hash_type otype;
596 bfd_vma osize;
597 bfd *nbfd;
598 enum bfd_link_hash_type ntype;
599 bfd_vma nsize;
600 {
601 if (! config.warn_common)
602 return true;
603
604 if (ntype == bfd_link_hash_defined)
605 {
606 ASSERT (otype == bfd_link_hash_common);
607 einfo ("%B: warning: definition of `%T' overriding common\n",
608 nbfd, name);
609 einfo ("%B: warning: common is here\n", obfd);
610 }
611 else if (otype == bfd_link_hash_defined)
612 {
613 ASSERT (ntype == bfd_link_hash_common);
614 einfo ("%B: warning: common of `%T' overridden by definition\n",
615 nbfd, name);
616 einfo ("%B: warning: defined here\n", obfd);
617 }
618 else
619 {
620 ASSERT (otype == bfd_link_hash_common && ntype == bfd_link_hash_common);
621 if (osize > nsize)
622 {
623 einfo ("%B: warning: common of `%T' overridden by larger common\n",
624 nbfd, name);
625 einfo ("%B: warning: larger common is here\n", obfd);
626 }
627 else if (nsize > osize)
628 {
629 einfo ("%B: warning: common of `%T' overriding smaller common\n",
630 nbfd, name);
631 einfo ("%B: warning: smaller common is here\n", obfd);
632 }
633 else
634 {
635 einfo ("%B: warning: multiple common of `%T'\n", nbfd, name);
636 einfo ("%B: warning: previous common is here\n", obfd);
637 }
638 }
639
640 return true;
641 }
642
643 /* This is called when BFD has discovered a set element. H is the
644 entry in the linker hash table for the set. SECTION and VALUE
645 represent a value which should be added to the set. */
646
647 /*ARGSUSED*/
648 static boolean
649 add_to_set (info, h, bitsize, abfd, section, value)
650 struct bfd_link_info *info;
651 struct bfd_link_hash_entry *h;
652 unsigned int bitsize;
653 bfd *abfd;
654 asection *section;
655 bfd_vma value;
656 {
657 ldctor_add_set_entry (h, bitsize, section, value);
658 return true;
659 }
660
661 /* This is called when BFD has discovered a constructor. This is only
662 called for some object file formats--those which do not handle
663 constructors in some more clever fashion. This is similar to
664 adding an element to a set, but less general. */
665
666 static boolean
667 constructor_callback (info, constructor, bitsize, name, abfd, section, value)
668 struct bfd_link_info *info;
669 boolean constructor;
670 unsigned int bitsize;
671 const char *name;
672 bfd *abfd;
673 asection *section;
674 bfd_vma value;
675 {
676 char *set_name;
677 char *s;
678 struct bfd_link_hash_entry *h;
679
680 if (! config.build_constructors)
681 return true;
682
683 set_name = (char *) alloca (1 + sizeof "__CTOR_LIST__");
684 s = set_name;
685 if (bfd_get_symbol_leading_char (abfd) != '\0')
686 *s++ = bfd_get_symbol_leading_char (abfd);
687 if (constructor)
688 strcpy (s, "__CTOR_LIST__");
689 else
690 strcpy (s, "__DTOR_LIST__");
691
692 if (write_map)
693 info_msg ("Adding %s to constructor/destructor set %s\n", name, set_name);
694
695 h = bfd_link_hash_lookup (info->hash, set_name, true, true, true);
696 if (h == (struct bfd_link_hash_entry *) NULL)
697 einfo ("%P%F: bfd_link_hash_lookup failed: %E");
698 if (h->type == bfd_link_hash_new)
699 {
700 h->type = bfd_link_hash_undefined;
701 h->u.undef.abfd = abfd;
702 /* We don't call bfd_link_add_undef to add this to the list of
703 undefined symbols because we are going to define it
704 ourselves. */
705 }
706
707 ldctor_add_set_entry (h, bitsize, section, value);
708 return true;
709 }
710
711 /* This is called when there is a reference to a warning symbol. */
712
713 /*ARGSUSED*/
714 static boolean
715 warning_callback (info, warning)
716 struct bfd_link_info *info;
717 const char *warning;
718 {
719 einfo ("%P: %s\n", warning);
720 return true;
721 }
722
723 /* This is called when an undefined symbol is found. */
724
725 /*ARGSUSED*/
726 static boolean
727 undefined_symbol (info, name, abfd, section, address)
728 struct bfd_link_info *info;
729 const char *name;
730 bfd *abfd;
731 asection *section;
732 bfd_vma address;
733 {
734 static char *error_name;
735 static unsigned int error_count;
736
737 #define MAX_ERRORS_IN_A_ROW 5
738
739 /* We never print more than a reasonable number of errors in a row
740 for a single symbol. */
741 if (error_name != (char *) NULL
742 && strcmp (name, error_name) == 0)
743 ++error_count;
744 else
745 {
746 error_count = 0;
747 if (error_name != (char *) NULL)
748 free (error_name);
749 error_name = buystring (name);
750 }
751
752 if (error_count < MAX_ERRORS_IN_A_ROW)
753 einfo ("%X%C: undefined reference to `%T'\n",
754 abfd, section, address, name);
755 else if (error_count == MAX_ERRORS_IN_A_ROW)
756 einfo ("%C: more undefined references to `%T' follow\n",
757 abfd, section, address, name);
758
759 return true;
760 }
761
762 /* This is called when a reloc overflows. */
763
764 /*ARGSUSED*/
765 static boolean
766 reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
767 struct bfd_link_info *info;
768 const char *name;
769 const char *reloc_name;
770 bfd_vma addend;
771 bfd *abfd;
772 asection *section;
773 bfd_vma address;
774 {
775 einfo ("%X%C: relocation truncated to fit: %s %T", abfd, section,
776 address, reloc_name, name);
777 if (addend != 0)
778 einfo ("+%v", addend);
779 einfo ("\n");
780 return true;
781 }
782
783 /* This is called when a dangerous relocation is made. */
784
785 /*ARGSUSED*/
786 static boolean
787 reloc_dangerous (info, message, abfd, section, address)
788 struct bfd_link_info *info;
789 const char *message;
790 bfd *abfd;
791 asection *section;
792 bfd_vma address;
793 {
794 einfo ("%X%C: dangerous relocation: %s\n", abfd, section, address, message);
795 return true;
796 }
797
798 /* This is called when a reloc is being generated attached to a symbol
799 that is not being output. */
800
801 /*ARGSUSED*/
802 static boolean
803 unattached_reloc (info, name, abfd, section, address)
804 struct bfd_link_info *info;
805 const char *name;
806 bfd *abfd;
807 asection *section;
808 bfd_vma address;
809 {
810 einfo ("%X%C: reloc refers to symbol `%T' which is not being output\n",
811 abfd, section, address, name);
812 return true;
813 }
814
815 /* This is called when a symbol in notice_hash is found. Symbols are
816 put in notice_hash using the -y option. */
817
818 /*ARGSUSED*/
819 static boolean
820 notice_ysym (info, name, abfd, section, value)
821 struct bfd_link_info *info;
822 const char *name;
823 bfd *abfd;
824 asection *section;
825 bfd_vma value;
826 {
827 einfo ("%B: %s %s\n", abfd,
828 section != &bfd_und_section ? "definition of" : "reference to",
829 name);
830 return true;
831 }
This page took 0.045938 seconds and 4 git commands to generate.