+ else if (sym.get_st_type() == elfcpp::STT_TLS)
+ lv.set_is_tls_symbol();
+
+ // Save the input symbol value for use in do_finalize_local_symbols().
+ lv.set_input_value(sym.get_st_value());
+
+ // Decide whether this symbol should go into the output file.
+
+ if (shndx < shnum && mo[shndx].output_section == NULL)
+ {
+ lv.set_no_output_symtab_entry();
+ continue;
+ }
+
+ if (sym.get_st_type() == elfcpp::STT_SECTION)
+ {
+ lv.set_no_output_symtab_entry();
+ continue;
+ }
+
+ if (sym.get_st_name() >= strtab_size)
+ {
+ this->error(_("local symbol %u section name out of range: %u >= %u"),
+ i, sym.get_st_name(),
+ static_cast<unsigned int>(strtab_size));
+ lv.set_no_output_symtab_entry();
+ continue;
+ }
+
+ // Add the symbol to the symbol table string pool.
+ const char* name = pnames + sym.get_st_name();
+ pool->add(name, true, NULL);
+ ++count;
+
+ // If needed, add the symbol to the dynamic symbol table string pool.
+ if (lv.needs_output_dynsym_entry())
+ {
+ dynpool->add(name, true, NULL);
+ ++dyncount;
+ }
+ }
+
+ this->output_local_symbol_count_ = count;
+ this->output_local_dynsym_count_ = dyncount;
+}
+
+// Finalize the local symbols. Here we add their values to
+// THIS->LOCAL_VALUES_ and set their output symbol table indexes.
+// This function is always called from a singleton thread. The actual
+// output of the local symbols will occur in a separate task.
+
+template<int size, bool big_endian>
+unsigned int
+Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
+ off_t off)
+{
+ gold_assert(off == static_cast<off_t>(align_address(off, size >> 3)));
+
+ const unsigned int loccount = this->local_symbol_count_;
+ this->local_symbol_offset_ = off;
+
+ const std::vector<Map_to_output>& mo(this->map_to_output());
+ unsigned int shnum = this->shnum();
+
+ for (unsigned int i = 1; i < loccount; ++i)
+ {
+ Symbol_value<size>& lv(this->local_values_[i]);
+
+ unsigned int shndx = lv.input_shndx();