- else if (sym->section != &bfd_und_section)
- {
- /* This is the definition of a symbol, add to def chain */
- if (sp->sdefs_chain && (*(sp->sdefs_chain))->section != sym->section)
- {
- /* Multiple definition */
- asymbol *sy = *(sp->sdefs_chain);
- lang_input_statement_type *stat =
- (lang_input_statement_type *) bfd_asymbol_bfd(sy)->usrdata;
- lang_input_statement_type *stat1 =
- (lang_input_statement_type *) bfd_asymbol_bfd(sym)->usrdata;
- asymbol **stat1_symbols = stat1 ? stat1->asymbols : 0;
- asymbol **stat_symbols = stat ? stat->asymbols : 0;
-
- multiple_def_count++;
- einfo ("%X%C: multiple definition of `%T'\n",
- bfd_asymbol_bfd(sym), sym->section, stat1_symbols, sym->value, sym);
-
- einfo ("%X%C: first seen here\n",
- bfd_asymbol_bfd(sy), sy->section, stat_symbols, sy->value);
- }
+ else if (sym->section != &bfd_und_section)
+ {
+ /* This is the definition of a symbol, add to def chain */
+ if (sp->sdefs_chain && (*(sp->sdefs_chain))->section != sym->section)
+ {
+ /* Multiple definition */
+ asymbol *sy = *(sp->sdefs_chain);
+ lang_input_statement_type *stat =
+ (lang_input_statement_type *) bfd_asymbol_bfd (sy)->usrdata;
+ lang_input_statement_type *stat1 =
+ (lang_input_statement_type *) bfd_asymbol_bfd (sym)->usrdata;
+ asymbol **stat1_symbols = stat1 ? stat1->asymbols : 0;
+ asymbol **stat_symbols = stat ? stat->asymbols : 0;
+
+ multiple_def_count++;
+ einfo ("%X%C: multiple definition of `%T'\n",
+ bfd_asymbol_bfd (sym), sym->section, stat1_symbols, sym->value, sym);
+
+ einfo ("%X%C: first seen here\n",
+ bfd_asymbol_bfd (sy), sy->section, stat_symbols, sy->value);
+ }
+ else
+ {
+ sym->udata = (PTR) (sp->sdefs_chain);
+ sp->sdefs_chain = nlist_p;
+ }
+ /* A definition overrides a common symbol */
+ if (sp->scoms_chain)
+ {
+ refize (sp, sp->scoms_chain);
+ sp->scoms_chain = 0;
+ commons_pending--;
+ }
+ else if (sp->srefs_chain && relaxing == false)
+ {
+ /* If previously was undefined, then remember as defined */
+ undefined_global_sym_count--;
+ }
+ }