gdb/testsuite: use the correct .debug_str section name for DW_FORM_strp
[binutils-gdb.git] / gold / incremental.cc
index f9471f87b9d264d0065b0045d1d006bdbdd7972e..ab258dd1896d9d5ef0b07f66d8e72d59b15bd5b2 100644 (file)
@@ -1,6 +1,6 @@
 // inremental.cc -- incremental linking support for gold
 
-// Copyright (C) 2009-2019 Free Software Foundation, Inc.
+// Copyright (C) 2009-2021 Free Software Foundation, Inc.
 // Written by Mikolaj Zalewski <mikolajz@google.com>.
 
 // This file is part of gold.
@@ -856,8 +856,8 @@ make_sized_incremental_binary(Output_file* file,
 {
   Target* target = select_target(NULL, 0, // XXX
                                 ehdr.get_e_machine(), size, big_endian,
-                                ehdr.get_e_ident()[elfcpp::EI_OSABI],
-                                ehdr.get_e_ident()[elfcpp::EI_ABIVERSION]);
+                                ehdr.get_ei_osabi(),
+                                ehdr.get_ei_abiversion());
   if (target == NULL)
     {
       explain_no_incremental(_("unsupported ELF machine number %d"),
@@ -2129,7 +2129,6 @@ Sized_relobj_incr<size, big_endian>::do_add_symbols(
 {
   const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
   unsigned char symbuf[sym_size];
-  elfcpp::Sym<size, big_endian> sym(symbuf);
   elfcpp::Sym_write<size, big_endian> osym(symbuf);
 
   typedef typename elfcpp::Elf_types<size>::Elf_WXword Elf_size_type;
@@ -2196,6 +2195,7 @@ Sized_relobj_incr<size, big_endian>::do_add_symbols(
       osym.put_st_other(gsym.get_st_other());
       osym.put_st_shndx(shndx);
 
+      elfcpp::Sym<size, big_endian> sym(symbuf);
       Symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym);
 
       if (shndx != elfcpp::SHN_UNDEF)
@@ -2730,7 +2730,6 @@ Sized_incr_dynobj<size, big_endian>::do_add_symbols(
 {
   const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
   unsigned char symbuf[sym_size];
-  elfcpp::Sym<size, big_endian> sym(symbuf);
   elfcpp::Sym_write<size, big_endian> osym(symbuf);
 
   unsigned int nsyms = this->input_reader_.get_global_symbol_count();
@@ -2795,6 +2794,7 @@ Sized_incr_dynobj<size, big_endian>::do_add_symbols(
       osym.put_st_other(gsym.get_st_other());
       osym.put_st_shndx(shndx);
 
+      elfcpp::Sym<size, big_endian> sym(symbuf);
       Sized_symbol<size>* res =
          symtab->add_from_incrobj<size, big_endian>(this, name, NULL, &sym);
       this->symbols_[i] = res;