+ Symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym);
+
+ if (shndx != elfcpp::SHN_UNDEF)
+ ++this->defined_count_;
+
+ // If this is a linker-defined symbol that hasn't yet been defined,
+ // define it now.
+ if (input_shndx == -1U && !res->is_defined())
+ {
+ shndx = gsym.get_st_shndx();
+ v = gsym.get_st_value();
+ Elf_size_type symsize = gsym.get_st_size();
+ if (shndx == elfcpp::SHN_ABS)
+ {
+ symtab->define_as_constant(name, NULL,
+ Symbol_table::INCREMENTAL_BASE,
+ v, symsize, st_type, st_bind,
+ gsym.get_st_visibility(), 0,
+ false, false);
+ }
+ else
+ {
+ Output_section* os = this->ibase_->output_section(shndx);
+ gold_assert(os != NULL && os->has_fixed_layout());
+ v -= os->address();
+ if (symsize > 0)
+ os->reserve(v, symsize);
+ symtab->define_in_output_data(name, NULL,
+ Symbol_table::INCREMENTAL_BASE,
+ os, v, symsize, st_type, st_bind,
+ gsym.get_st_visibility(), 0,
+ false, false);
+ }
+ }
+
+ this->symbols_[i] = res;
+ this->ibase_->add_global_symbol(output_symndx - first_global, res);