1 /* Copyright (C) 1991 Free Software Foundation, Inc.
2 Written by Steve Chamberlain steve@cygnus.com
4 This file is part of GLD, the Gnu Linker.
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)
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.
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
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
41 #if !defined(S_ISDIR) && defined(S_IFDIR)
42 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
47 static char *get_emulation ();
48 static void set_scripts_dir ();
51 extern boolean lang_has_input_file;
52 extern boolean trace_files;
57 char *output_filename = "a.out";
59 /* Name this program was invoked by. */
62 /* The file that we're creating */
65 extern boolean option_v;
67 /* set if -y on the command line */
70 /* The local symbol prefix */
73 /* Set by -G argument, for MIPS ECOFF target. */
74 int g_switch_value = 8;
76 /* Count the number of global symbols multiply defined. */
77 int multiple_def_count;
79 /* Count the number of symbols defined through common declarations.
80 This count is referenced in symdef_library, linear_library, and
81 modified by enter_global_ref.
83 It is incremented when a symbol is created as a common, and
84 decremented when the common declaration is overridden
86 Another way of thinking of it is that this is a count of
87 all ldsym_types with a ->scoms field */
89 unsigned int commons_pending;
91 /* Count the number of global symbols referenced and not defined.
92 common symbols are not included in this count. */
94 unsigned int undefined_global_sym_count;
96 /* Count the number of warning symbols encountered. */
99 /* have we had a load script ? */
100 extern boolean had_script;
102 /* Nonzero means print names of input files as processed. */
105 /* 1 => write load map. */
109 /* Indicates whether output file will be b.out (default) or coff */
110 enum target_flavour output_flavor = BFD_BOUT_FORMAT;
114 /* Force the make_executable to be output, even if there are non-fatal
116 boolean force_make_executable;
118 /* A count of the total number of local symbols ever seen - by adding
119 the symbol_count field of each newly read afile.*/
121 unsigned int total_symbols_seen;
123 /* A count of the number of read files - the same as the number of elements
126 unsigned int total_files_seen;
128 args_type command_line;
130 ld_config_type config;
139 program_name = argv[0];
143 /* Initialize the data about options. */
148 config.relocateable_output = false;
149 command_line.force_common_definition = false;
151 init_bfd_error_vector ();
153 ldfile_add_arch ("");
157 config.make_executable = true;
158 force_make_executable = false;
161 /* Initialize the cumulative counts of symbols. */
162 undefined_global_sym_count = 0;
164 multiple_def_count = 0;
167 config.magic_demand_paged = true;
168 config.text_read_only = true;
169 config.make_executable = true;
171 emulation = get_emulation (argc, argv);
172 ldemul_choose_mode (emulation);
173 default_target = ldemul_choose_target ();
175 ldemul_before_parse ();
176 lang_has_input_file = false;
177 parse_args (argc, argv);
179 if (config.relocateable_output && command_line.relax)
181 einfo ("%P%F: -relax and -r may not be used together\n");
187 info ("%P: mode %s\n", emulation);
189 if (lang_has_input_file == false)
191 einfo ("%P%F: No input files\n");
194 ldemul_after_parse ();
197 if (config.map_filename)
199 if (strcmp (config.map_filename, "-") == 0)
201 config.map_file = stdout;
205 config.map_file = fopen (config.map_filename, FOPEN_WT);
206 if (config.map_file == (FILE *) NULL)
208 einfo ("%P%F: can't open map file %s\n",
209 config.map_filename);
217 /* Print error messages for any missing symbols, for any warning
218 symbols, and possibly multiple definitions */
221 if (config.text_read_only)
223 /* Look for a text section and mark the readonly attribute in it */
224 asection *found = bfd_get_section_by_name (output_bfd, ".text");
226 if (found != (asection *) NULL)
228 found->flags |= SEC_READONLY;
232 if (config.relocateable_output)
233 output_bfd->flags &= ~EXEC_P;
235 output_bfd->flags |= EXEC_P;
239 /* Even if we're producing relocateable output, some non-fatal errors should
240 be reported in the exit status. (What non-fatal errors, if any, do we
241 want to ignore for relocateable output?) */
243 if (config.make_executable == false && force_make_executable == false)
245 if (trace_files == true)
247 einfo ("%P: Link errors found, deleting executable `%s'\n",
251 if (output_bfd->iostream)
252 fclose ((FILE *) (output_bfd->iostream));
254 unlink (output_filename);
259 bfd_close (output_bfd);
265 /* We need to find any explicitly given emulation in order to initialize the
266 state that's needed by the lex&yacc argument parser (parse_args). */
269 get_emulation (argc, argv)
277 check_v960 (argc, argv);
278 emulation = "gld960";
279 for (i = 1; i < argc; i++)
281 if (!strcmp (argv[i], "-Fcoff"))
283 emulation = "lnk960";
284 output_flavor = BFD_COFF_FORMAT;
289 emulation = (char *) getenv (EMULATION_ENVIRON);
290 if (emulation == NULL)
291 emulation = DEFAULT_EMULATION;
294 for (i = 1; i < argc; i++)
296 if (!strncmp (argv[i], "-m", 2))
298 if (argv[i][2] == '\0')
303 emulation = argv[i + 1];
308 einfo("%P%F missing argument to -m\n");
314 emulation = &argv[i][2];
322 /* If directory DIR contains an "ldscripts" subdirectory,
323 add DIR to the library search path and return true,
324 else return false. */
327 check_for_scripts_dir (dir)
335 dirlen = strlen (dir);
336 /* sizeof counts the terminating NUL. */
337 buf = (char *) ldmalloc (dirlen + sizeof("/ldscripts"));
338 sprintf (buf, "%s/ldscripts", dir);
340 res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
343 ldfile_add_library_path (dir);
347 /* Set the default directory for finding script files.
348 Libraries will be searched for here too, but that's ok.
349 We look for the "ldscripts" directory in:
352 SCRIPTDIR (passed from Makefile)
353 the dir where this program is
354 the dir where this program is/../lib */
362 if (check_for_scripts_dir ("."))
363 return; /* Newest version, most likely. */
365 if (check_for_scripts_dir (SCRIPTDIR))
366 return; /* We've been installed normally. */
368 /* Look for "ldscripts" in the dir where our binary is. */
369 end = strrchr (program_name, '/');
373 /* Make a copy of program_name in dir. */
374 dirlen = end - program_name;
375 dir = (char *) ldmalloc (dirlen + 8); /* Leave room for later "/../lib". */
376 strncpy (dir, program_name, dirlen);
378 if (check_for_scripts_dir (dir))
379 return; /* Don't free dir. */
381 /* Look for "ldscripts" in <the dir where our binary is>/../lib. */
382 strcpy (dir + dirlen, "/../lib");
383 if (check_for_scripts_dir (dir))
386 free (dir); /* Well, we tried. */
390 Q_read_entry_symbols (desc, entry)
392 struct lang_input_statement_struct *entry;
394 if (entry->asymbols == (asymbol **) NULL)
396 bfd_size_type table_size = get_symtab_upper_bound (desc);
398 entry->asymbols = (asymbol **) ldmalloc (table_size);
399 entry->symbol_count = bfd_canonicalize_symtab (desc, entry->asymbols);
404 * turn this item into a reference
411 asymbol *sym = *nlist_p;
415 sym->section = &bfd_und_section;
416 sym->udata = (PTR) (sp->srefs_chain);
417 sp->srefs_chain = nlist_p;
421 This function is called for each name which is seen which has a global
422 scope. It enters the name into the global symbol table in the correct
423 symbol on the correct chain. Remember that each ldsym_type has three
424 chains attatched, one of all definitions of a symbol, one of all
425 references of a symbol and one of all common definitions of a symbol.
427 When the function is over, the supplied is left connected to the bfd
428 to which is was born, with its udata field pointing to the next member
429 on the chain in which it has been inserted.
431 A certain amount of jigery pokery is necessary since commons come
432 along and upset things, we only keep one item in the common chain; the
433 one with the biggest size seen sofar. When another common comes along
434 it either bumps the previous definition into the ref chain, since it
435 is bigger, or gets turned into a ref on the spot since the one on the
436 common chain is already bigger. If a real definition comes along then
437 the common gets bumped off anyway.
439 Whilst all this is going on we keep a count of the number of multiple
440 definitions seen, undefined global symbols and pending commons.
443 extern boolean relaxing;
446 Q_enter_global_ref (nlist_p, name)
447 asymbol ** nlist_p; /* pointer into symbol table from incoming bfd */
448 CONST char *name; /* name of symbol in linker table */
450 asymbol *sym = *nlist_p;
453 /* Lookup the name from the incoming bfd's symbol table in the
454 linker's global symbol table */
457 flagword this_symbol_flags = sym->flags;
459 sp = ldsym_get (name);
462 /* If this symbol already has udata, it means that something strange
465 The strange thing is that we've had an undefined symbol resolved by
466 an alias, but the thing the alias defined wasn't in the file. So
467 the symbol got a udata entry, but the file wasn't loaded. Then
468 later on the file was loaded, but we don't need to do this
476 if (flag_is_constructor (this_symbol_flags))
478 /* Add this constructor to the list we keep */
479 ldlang_add_constructor (sp);
480 /* Turn any commons into refs */
481 if (sp->scoms_chain != (asymbol **) NULL)
483 refize (sp, sp->scoms_chain);
491 if (bfd_is_com_section (sym->section))
493 /* If we have a definition of this symbol already then
494 this common turns into a reference. Also we only
495 ever point to the largest common, so if we
496 have a common, but it's bigger that the new symbol
497 the turn this into a reference too. */
500 /* This is a common symbol, but we already have a definition
501 for it, so just link it into the ref chain as if
502 it were a reference */
503 refize (sp, nlist_p);
505 else if (sp->scoms_chain)
507 /* If we have a previous common, keep only the biggest */
508 if ((*(sp->scoms_chain))->value > sym->value)
510 /* other common is bigger, throw this one away */
511 refize (sp, nlist_p);
513 else if (sp->scoms_chain != nlist_p)
515 /* other common is smaller, throw that away */
516 refize (sp, sp->scoms_chain);
517 sp->scoms_chain = nlist_p;
522 /* This is the first time we've seen a common, so remember it
523 - if it was undefined before, we know it's defined now. If
524 the symbol has been marked as really being a constructor,
525 then treat this as a ref
527 if (sp->flags & SYM_CONSTRUCTOR)
529 /* Turn this into a ref */
530 refize (sp, nlist_p);
534 /* treat like a common */
536 undefined_global_sym_count--;
539 sp->scoms_chain = nlist_p;
544 else if (sym->section != &bfd_und_section)
546 /* This is the definition of a symbol, add to def chain */
547 if (sp->sdefs_chain && (*(sp->sdefs_chain))->section != sym->section)
549 /* Multiple definition */
550 asymbol *sy = *(sp->sdefs_chain);
551 lang_input_statement_type *stat =
552 (lang_input_statement_type *) bfd_asymbol_bfd (sy)->usrdata;
553 lang_input_statement_type *stat1 =
554 (lang_input_statement_type *) bfd_asymbol_bfd (sym)->usrdata;
555 asymbol **stat1_symbols = stat1 ? stat1->asymbols : 0;
556 asymbol **stat_symbols = stat ? stat->asymbols : 0;
558 multiple_def_count++;
559 einfo ("%X%C: multiple definition of `%T'\n",
560 bfd_asymbol_bfd (sym), sym->section, stat1_symbols, sym->value, sym);
562 einfo ("%X%C: first seen here\n",
563 bfd_asymbol_bfd (sy), sy->section, stat_symbols, sy->value);
567 sym->udata = (PTR) (sp->sdefs_chain);
568 sp->sdefs_chain = nlist_p;
570 /* A definition overrides a common symbol */
573 refize (sp, sp->scoms_chain);
577 else if (sp->srefs_chain && relaxing == false)
579 /* If previously was undefined, then remember as defined */
580 undefined_global_sym_count--;
585 if (sp->scoms_chain == (asymbol **) NULL
586 && sp->srefs_chain == (asymbol **) NULL
587 && sp->sdefs_chain == (asymbol **) NULL)
589 /* And it's the first time we've seen it */
590 undefined_global_sym_count++;
594 refize (sp, nlist_p);
598 ASSERT (sp->sdefs_chain == 0 || sp->scoms_chain == 0);
599 ASSERT (sp->scoms_chain == 0 || (*(sp->scoms_chain))->udata == 0);
605 Q_enter_file_symbols (entry)
606 lang_input_statement_type *entry;
610 entry->common_section =
611 bfd_make_section_old_way (entry->the_bfd, "COMMON");
612 entry->common_section->flags = SEC_NEVER_LOAD;
613 ldlang_add_file (entry);
616 if (trace_files || option_v)
618 info ("%I\n", entry);
621 total_symbols_seen += entry->symbol_count;
623 if (entry->symbol_count)
625 for (q = entry->asymbols; *q; q++)
629 if (had_y && p->name)
631 /* look up the symbol anyway to see if the trace bit was
633 ldsym_type *s = ldsym_get (p->name);
634 if (s->flags & SYM_Y)
636 einfo ("%B: %s %T\n", entry->the_bfd,
637 p->section == &bfd_und_section ? "reference to" : "definition of ",
642 if (p->section == &bfd_ind_section)
646 else if (p->flags & BSF_WARNING)
650 else if (p->section == &bfd_und_section
651 || (p->flags & BSF_GLOBAL)
652 || bfd_is_com_section (p->section)
653 || (p->flags & BSF_CONSTRUCTOR))
659 if (p->flags & BSF_INDIRECT)
663 else if (p->flags & BSF_WARNING)
667 else if (p->section == &bfd_und_section
668 || (p->flags & BSF_GLOBAL)
669 || bfd_is_com_section (p->section)
670 || (p->flags & BSF_CONSTRUCTOR))
672 Q_enter_global_ref (q, p->name);
682 /* Searching libraries */
684 struct lang_input_statement_struct *decode_library_subfile ();
685 void linear_library (), symdef_library ();
687 /* Search the library ENTRY, already open on descriptor DESC.
688 This means deciding which library members to load,
689 making a chain of `struct lang_input_statement_struct' for those members,
690 and entering their global symbols in the hash table. */
693 search_library (entry)
694 struct lang_input_statement_struct *entry;
697 /* No need to load a library if no undefined symbols */
698 if (!undefined_global_sym_count)
701 if (bfd_has_map (entry->the_bfd))
702 symdef_library (entry);
704 linear_library (entry);
711 gnu960_check_format (abfd, format)
717 if ((bfd_check_format (abfd, format) == true)
718 && (abfd->xvec->flavour == output_flavor))
730 ldmain_open_file_read_symbol (entry)
731 struct lang_input_statement_struct *entry;
733 if (entry->asymbols == (asymbol **) NULL
734 && entry->real == true
735 && entry->filename != (char *) NULL)
737 ldfile_open_file (entry);
741 if (gnu960_check_format (entry->the_bfd, bfd_object))
743 if (bfd_check_format (entry->the_bfd, bfd_object))
746 entry->the_bfd->usrdata = (PTR) entry;
749 Q_read_entry_symbols (entry->the_bfd, entry);
751 /* look through the sections in the file and see if any of them
753 ldlang_check_for_constructors (entry);
755 Q_enter_file_symbols (entry);
758 else if (gnu960_check_format (entry->the_bfd, bfd_archive))
760 else if (bfd_check_format (entry->the_bfd, bfd_archive))
763 entry->the_bfd->usrdata = (PTR) entry;
765 entry->subfiles = (lang_input_statement_type *) NULL;
766 search_library (entry);
770 einfo ("%F%B: malformed input file (not rel or archive) \n",
777 /* Construct and return a lang_input_statement_struct for a library member.
778 The library's lang_input_statement_struct is library_entry,
779 and the library is open on DESC.
780 SUBFILE_OFFSET is the byte index in the library of this member's header.
781 We store the length of the member into *LENGTH_LOC. */
783 lang_input_statement_type *
784 decode_library_subfile (library_entry, subfile_offset)
785 struct lang_input_statement_struct *library_entry;
788 register struct lang_input_statement_struct *subentry;
791 /* First, check if we already have a loaded
792 lang_input_statement_struct for this library subfile. If so,
793 just return it. Otherwise, allocate some space and build a new one. */
795 if (subfile_offset->usrdata
796 && ((struct lang_input_statement_struct *) subfile_offset->usrdata)->
799 subentry = (struct lang_input_statement_struct *) subfile_offset->usrdata;
804 (struct lang_input_statement_struct *)
805 ldmalloc ((bfd_size_type) (sizeof (struct lang_input_statement_struct)));
807 subentry->filename = subfile_offset->filename;
808 subentry->local_sym_name = subfile_offset->filename;
809 subentry->asymbols = 0;
810 subentry->the_bfd = subfile_offset;
811 subentry->subfiles = 0;
813 subentry->superfile = library_entry;
814 subentry->is_archive = false;
816 subentry->just_syms_flag = false;
817 subentry->loaded = false;
823 boolean subfile_wanted_p ();
825 clear_syms (entry, offset)
826 struct lang_input_statement_struct *entry;
830 unsigned long indx = bfd_get_next_mapent (entry->the_bfd,
834 while (indx != BFD_NO_MORE_SYMBOLS)
836 if (car->file_offset == offset)
840 indx = bfd_get_next_mapent (entry->the_bfd, indx, &car);
845 /* Search a library that has a map
848 symdef_library (entry)
849 struct lang_input_statement_struct *entry;
852 register struct lang_input_statement_struct *prev = 0;
854 boolean not_finished = true;
856 while (not_finished == true)
858 carsym *exported_library_name;
859 bfd *prev_archive_member_bfd = 0;
861 int idx = bfd_get_next_mapent (entry->the_bfd,
863 &exported_library_name);
865 not_finished = false;
867 while (idx != BFD_NO_MORE_SYMBOLS && undefined_global_sym_count)
870 if (exported_library_name->name)
873 ldsym_type *sp = ldsym_get_soft (exported_library_name->name);
875 /* If we find a symbol that appears to be needed, think carefully
876 about the archive member that the symbol is in. */
877 /* So - if it exists, and is referenced somewhere and is
879 if (sp && sp->srefs_chain && !sp->sdefs_chain)
881 bfd *archive_member_bfd = bfd_get_elt_at_index (entry->the_bfd, idx);
882 struct lang_input_statement_struct *archive_member_lang_input_statement_struct;
885 if (archive_member_bfd && gnu960_check_format (archive_member_bfd, bfd_object))
887 if (archive_member_bfd && bfd_check_format (archive_member_bfd, bfd_object))
891 /* Don't think carefully about any archive member
892 more than once in a given pass. */
893 if (prev_archive_member_bfd != archive_member_bfd)
896 prev_archive_member_bfd = archive_member_bfd;
898 /* Read the symbol table of the archive member. */
900 if (archive_member_bfd->usrdata != (PTR) NULL)
903 archive_member_lang_input_statement_struct = (lang_input_statement_type *) archive_member_bfd->usrdata;
908 archive_member_lang_input_statement_struct =
909 decode_library_subfile (entry, archive_member_bfd);
910 archive_member_bfd->usrdata = (PTR) archive_member_lang_input_statement_struct;
914 if (archive_member_lang_input_statement_struct == 0)
916 einfo ("%F%I contains invalid archive member %s\n",
920 if (archive_member_lang_input_statement_struct->loaded == false)
923 Q_read_entry_symbols (archive_member_bfd, archive_member_lang_input_statement_struct);
924 /* Now scan the symbol table and decide whether to load. */
927 if (subfile_wanted_p (archive_member_lang_input_statement_struct) == true)
930 /* This member is needed; load it.
931 Since we are loading something on this pass,
932 we must make another pass through the symdef data. */
936 Q_enter_file_symbols (archive_member_lang_input_statement_struct);
939 prev->chain = archive_member_lang_input_statement_struct;
941 entry->subfiles = archive_member_lang_input_statement_struct;
944 prev = archive_member_lang_input_statement_struct;
947 /* Clear out this member's symbols from the symdef data
948 so that following passes won't waste time on them. */
949 clear_syms (entry, exported_library_name->file_offset);
950 archive_member_lang_input_statement_struct->loaded = true;
957 idx = bfd_get_next_mapent (entry->the_bfd, idx, &exported_library_name);
963 linear_library (entry)
964 struct lang_input_statement_struct *entry;
966 boolean more_to_do = true;
967 register struct lang_input_statement_struct *prev = 0;
969 if (entry->complained == false)
971 if (entry->the_bfd->xvec->flavour != bfd_target_ieee_flavour)
974 /* IEEE can use table of contents, so this message is bogus */
975 einfo ("%P: library %s has bad table of contents, rerun ranlib\n",
976 entry->the_bfd->filename);
978 entry->complained = true;
984 bfd *archive = bfd_openr_next_archived_file (entry->the_bfd, 0);
989 /* Don't check this file if it's already been read in
992 if (!archive->usrdata ||
993 !((lang_input_statement_type *) (archive->usrdata))->loaded)
996 if (gnu960_check_format (archive, bfd_object))
998 if (bfd_check_format (archive, bfd_object))
1001 register struct lang_input_statement_struct *subentry;
1003 subentry = decode_library_subfile (entry,
1006 archive->usrdata = (PTR) subentry;
1009 if (subentry->loaded == false)
1011 Q_read_entry_symbols (archive, subentry);
1013 if (subfile_wanted_p (subentry) == true)
1015 Q_enter_file_symbols (subentry);
1018 prev->chain = subentry;
1020 entry->subfiles = subentry;
1024 subentry->loaded = true;
1029 archive = bfd_openr_next_archived_file (entry->the_bfd, archive);
1036 /* ENTRY is an entry for a file inside an archive
1037 Its symbols have been read into core, but not entered into the
1039 Return nonzero if we ought to load this file */
1042 subfile_wanted_p (entry)
1043 struct lang_input_statement_struct *entry;
1047 if (entry->symbol_count == 0)
1050 for (q = entry->asymbols; *q; q++)
1054 /* If the symbol has an interesting definition, we could
1055 potentially want it. */
1057 if (p->flags & BSF_INDIRECT)
1059 /** add_indirect(q);*/
1062 if (bfd_is_com_section (p->section)
1063 || (p->flags & BSF_GLOBAL)
1064 || (p->flags & BSF_INDIRECT))
1066 register ldsym_type *sp = ldsym_get_soft (p->name);
1068 /* If this symbol has not been hashed,
1069 we can't be looking for it. */
1070 if (sp != (ldsym_type *) NULL
1071 && sp->sdefs_chain == (asymbol **) NULL)
1073 if (sp->srefs_chain != (asymbol **) NULL
1074 || sp->scoms_chain != (asymbol **) NULL)
1076 /* This is a symbol we are looking for. It is
1077 either not yet defined or common. If this is a
1078 common symbol, then if the symbol in the object
1079 file is common, we need to combine sizes. But if
1080 we already have a common symbol, and the symbol
1081 in the object file is not common, we don't want
1082 the object file: it is providing a definition for
1083 a symbol that we already have a definition for
1084 (this is the else condition below). */
1085 if (bfd_is_com_section (p->section))
1088 /* If the symbol in the table is a constructor, we won't to
1089 anything fancy with it */
1090 if ((sp->flags & SYM_CONSTRUCTOR) == 0)
1092 /* This libary member has something to
1093 say about this element. We should
1094 remember if its a new size */
1095 /* Move something from the ref list to the com list */
1096 if (sp->scoms_chain)
1098 /* Already a common symbol, maybe update it */
1099 if (p->value > (*(sp->scoms_chain))->value)
1101 (*(sp->scoms_chain))->value = p->value;
1106 /* Take a value from the ref chain
1107 Here we are moving a symbol from the owning bfd
1108 to another bfd. We must set up the
1109 common_section portion of the bfd thing */
1113 sp->scoms_chain = sp->srefs_chain;
1115 (asymbol **) ((*(sp->srefs_chain))->udata);
1116 (*(sp->scoms_chain))->udata = (PTR) NULL;
1118 (*(sp->scoms_chain))->section = p->section;
1119 (*(sp->scoms_chain))->flags = 0;
1120 /* Remember the size of this item */
1121 sp->scoms_chain[0]->value = p->value;
1123 undefined_global_sym_count--;
1126 asymbol *com = *(sp->scoms_chain);
1128 if (((lang_input_statement_type *)
1129 (bfd_asymbol_bfd (com)->usrdata))->common_section ==
1132 ((lang_input_statement_type *)
1133 (bfd_asymbol_bfd (com)->usrdata))->common_section =
1134 bfd_make_section_old_way (bfd_asymbol_bfd (com), "COMMON");
1138 ASSERT (p->udata == 0);
1140 else if (sp->scoms_chain == (asymbol **) NULL)
1144 info ("%I needed due to %s\n", entry, sp->name);
1160 ldsym_type *lookup = ldsym_get (text);
1161 lookup->flags |= SYM_Y;