+ *pstatus = CFVS_OK;
+ return value;
+}
+
+// Finalize the symbol SYM. This returns true if the symbol should be
+// added to the symbol table, false otherwise.
+
+template<int size>
+bool
+Symbol_table::sized_finalize_symbol(Symbol* unsized_sym)
+{
+ typedef typename Sized_symbol<size>::Value_type Value_type;
+
+ Sized_symbol<size>* sym = static_cast<Sized_symbol<size>*>(unsized_sym);
+
+ // The default version of a symbol may appear twice in the symbol
+ // table. We only need to finalize it once.
+ if (sym->has_symtab_index())
+ return false;
+
+ if (!sym->in_reg())
+ {
+ gold_assert(!sym->has_symtab_index());
+ sym->set_symtab_index(-1U);
+ gold_assert(sym->dynsym_index() == -1U);
+ return false;
+ }
+
+ // Compute final symbol value.
+ Compute_final_value_status status;
+ Value_type value = this->compute_final_value(sym, &status);
+
+ switch (status)
+ {
+ case CFVS_OK:
+ break;
+ case CFVS_UNSUPPORTED_SYMBOL_SECTION:
+ {
+ bool is_ordinary;
+ unsigned int shndx = sym->shndx(&is_ordinary);
+ gold_error(_("%s: unsupported symbol section 0x%x"),
+ sym->demangled_name().c_str(), shndx);
+ }
+ break;
+ case CFVS_NO_OUTPUT_SECTION:
+ sym->set_symtab_index(-1U);
+ return false;
+ default:
+ gold_unreachable();
+ }
+