Sort includes for files gdb/[a-f]*.[chyl].
[deliverable/binutils-gdb.git] / gdb / elfread.c
index 10daef053697eeea617ed475983aafc1f0b04d58..6d67418fa0a7ee76458d453aa92d5910660f5d1f 100644 (file)
@@ -1,6 +1,6 @@
 /* Read ELF (Executable and Linking Format) object files for GDB.
 
-   Copyright (C) 1991-2018 Free Software Foundation, Inc.
+   Copyright (C) 1991-2019 Free Software Foundation, Inc.
 
    Written by Fred Fish at Cygnus Support.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+
+/* Local non-gdb includes.  */
+#include "arch-utils.h"
+#include "auxv.h"
+#include "bcache.h"
 #include "bfd.h"
+#include "build-id.h"
+#include "complaints.h"
+#include "demangle.h"
 #include "elf-bfd.h"
 #include "elf/common.h"
 #include "elf/internal.h"
 #include "elf/mips.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "buildsym.h"
-#include "stabsread.h"
-#include "gdb-stabs.h"
-#include "complaints.h"
-#include "demangle.h"
-#include "psympriv.h"
 #include "filenames.h"
-#include "probe.h"
-#include "arch-utils.h"
+#include "gdb-stabs.h"
+#include "gdb_bfd.h"
+#include "gdbthread.h"
 #include "gdbtypes.h"
-#include "value.h"
 #include "infcall.h"
-#include "gdbthread.h"
 #include "inferior.h"
-#include "regcache.h"
-#include "bcache.h"
-#include "gdb_bfd.h"
-#include "build-id.h"
 #include "location.h"
-#include "auxv.h"
+#include "mdebugread.h"
+#include "objfiles.h"
+#include "probe.h"
+#include "psympriv.h"
+#include "regcache.h"
+#include "stabsread.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "value.h"
 
 /* Forward declarations.  */
 extern const struct sym_fns elf_sym_fns_gdb_index;
@@ -334,8 +336,8 @@ elf_symtab_read (minimal_symbol_reader &reader,
       if (sym->flags & BSF_FILE)
        {
          filesymname
-           = (const char *) bcache (sym->name, strlen (sym->name) + 1,
-                                    objfile->per_bfd->filename_cache);
+           = ((const char *) objfile->per_bfd->filename_cache.insert
+              (sym->name, strlen (sym->name) + 1));
        }
       else if (sym->flags & BSF_SECTION_SYM)
        continue;
@@ -759,9 +761,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
 static int
 elf_gnu_ifunc_resolve_by_cache (const char *name, CORE_ADDR *addr_p)
 {
-  struct objfile *objfile;
-
-  ALL_PSPACE_OBJFILES (current_program_space, objfile)
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       htab_t htab;
       struct elf_gnu_ifunc_cache *entry_p;
@@ -801,13 +801,12 @@ static int
 elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
 {
   char *name_got_plt;
-  struct objfile *objfile;
   const size_t got_suffix_len = strlen (SYMBOL_GOT_PLT_SUFFIX);
 
   name_got_plt = (char *) alloca (strlen (name) + got_suffix_len + 1);
   sprintf (name_got_plt, "%s" SYMBOL_GOT_PLT_SUFFIX, name);
 
-  ALL_PSPACE_OBJFILES (current_program_space, objfile)
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       bfd *obfd = objfile->obfd;
       struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -905,7 +904,7 @@ elf_gnu_ifunc_resolve_addr (struct gdbarch *gdbarch, CORE_ADDR pc)
   target_auxv_search (current_top_target (), AT_HWCAP, &hwcap);
   hwcap_val = value_from_longest (builtin_type (gdbarch)
                                  ->builtin_unsigned_long, hwcap);
-  address_val = call_function_by_hand (function, NULL, 1, &hwcap_val);
+  address_val = call_function_by_hand (function, NULL, hwcap_val);
   address = value_as_address (address_val);
   address = gdbarch_convert_from_func_ptr_addr (gdbarch, address, current_top_target ());
   address = gdbarch_addr_bits_remove (gdbarch, address);
@@ -1297,9 +1296,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 
       if (!debugfile.empty ())
        {
-         gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile.c_str ()));
+         gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile.c_str ()));
 
-         symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+         symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
                                    symfile_flags, objfile);
        }
     }
This page took 0.03009 seconds and 4 git commands to generate.