- asymbol **q;
-
- for (q = entry->asymbols; *q; q++)
- {
- asymbol *p = *q;
-
- /* If the symbol has an interesting definition, we could
- potentially want it. */
-
- if (p->flags & BSF_INDIRECT) {
- /* Grab out the name we've indirected to, and keep the insides
- */
- add_indirect(q);
- }
-
- if (p->flags & BSF_FORT_COMM
- || p->flags & BSF_GLOBAL)
- {
- register ldsym_type *sp = ldsym_get_soft (p->name);
-
-
- /* If this symbol has not been hashed,
- we can't be looking for it. */
- if (sp != (ldsym_type *)NULL
- && sp->sdefs_chain == (asymbol **)NULL) {
- if (sp->srefs_chain != (asymbol **)NULL
- || sp->scoms_chain != (asymbol **)NULL)
- {
- /* This is a symbol we are looking for. It is either
- not yet defined or common. */
-
- if (flag_is_common(p->flags))
- {
-
- /* If the symbol in the table is a constructor, we won't to
- anything fancy with it */
- if ((sp->flags & SYM_CONSTRUCTOR) == 0) {
- /* This libary member has something to
- say about this element. We should
- remember if its a new size */
- /* Move something from the ref list to the com list */
- if(sp->scoms_chain) {
- /* Already a common symbol, maybe update it */
- if (p->value > (*(sp->scoms_chain))->value) {
- (*(sp->scoms_chain))->value = p->value;
- }
- }
- else {
- /* Take a value from the ref chain
- Here we are moving a symbol from the owning bfd
- to another bfd. We must set up the
- common_section portion of the bfd thing */
-
-
-
- sp->scoms_chain = sp->srefs_chain;
- sp->srefs_chain =
- (asymbol **)((*(sp->srefs_chain))->udata);
- (*(sp->scoms_chain))->udata = (PTR)NULL;
-
- (*( sp->scoms_chain))->flags = BSF_FORT_COMM;
- /* Remember the size of this item */
- sp->scoms_chain[0]->value = p->value;
- commons_pending++;
- undefined_global_sym_count--;
- } {
- asymbol *com = *(sp->scoms_chain);
- if (((lang_input_statement_type *)
- (com->the_bfd->usrdata))->common_section ==
- (asection *)NULL) {
- ((lang_input_statement_type *)
- (com->the_bfd->usrdata))->common_section =
- bfd_make_section(com->the_bfd, "COMMON");
- }
- }
- }
- ASSERT(p->udata == 0);
- }
-
- else {
- if (write_map)
- {
- info("%I needed due to %s\n",entry, sp->name);
- }
- return true;
- }
- }
- }
- }
- }