diff --git a/gold/incremental.cc b/gold/incremental.cc index 1f2ae5b87b..525c92cff6 100644 --- a/gold/incremental.cc +++ b/gold/incremental.cc @@ -2129,7 +2129,6 @@ Sized_relobj_incr::do_add_symbols( { const int sym_size = elfcpp::Elf_sizes::sym_size; unsigned char symbuf[sym_size]; - elfcpp::Sym sym(symbuf); elfcpp::Sym_write osym(symbuf); typedef typename elfcpp::Elf_types::Elf_WXword Elf_size_type; @@ -2196,6 +2195,7 @@ Sized_relobj_incr::do_add_symbols( osym.put_st_other(gsym.get_st_other()); osym.put_st_shndx(shndx); + elfcpp::Sym sym(symbuf); Symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym); if (shndx != elfcpp::SHN_UNDEF) @@ -2730,7 +2730,6 @@ Sized_incr_dynobj::do_add_symbols( { const int sym_size = elfcpp::Elf_sizes::sym_size; unsigned char symbuf[sym_size]; - elfcpp::Sym sym(symbuf); elfcpp::Sym_write osym(symbuf); unsigned int nsyms = this->input_reader_.get_global_symbol_count(); @@ -2795,6 +2794,7 @@ Sized_incr_dynobj::do_add_symbols( osym.put_st_other(gsym.get_st_other()); osym.put_st_shndx(shndx); + elfcpp::Sym sym(symbuf); Sized_symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym); this->symbols_[i] = res; diff --git a/gold/plugin.cc b/gold/plugin.cc index fd37957e73..5f5da5dcea 100644 --- a/gold/plugin.cc +++ b/gold/plugin.cc @@ -1397,7 +1397,6 @@ Sized_pluginobj::do_add_symbols(Symbol_table* symtab, { const int sym_size = elfcpp::Elf_sizes::sym_size; unsigned char symbuf[sym_size]; - elfcpp::Sym sym(symbuf); elfcpp::Sym_write osym(symbuf); Plugin_recorder* recorder = parameters->options().plugins()->recorder(); @@ -1480,6 +1479,7 @@ Sized_pluginobj::do_add_symbols(Symbol_table* symtab, osym.put_st_other(vis, 0); osym.put_st_shndx(shndx); + elfcpp::Sym sym(symbuf); this->symbols_[i] = symtab->add_from_pluginobj(this, name, ver, &sym); }