ld -plugin options when plugins are disabled
[deliverable/binutils-gdb.git] / gdb / solib-aix.c
index 8308190d90cd0f8933ef4b899e72dd13ce629ee1..344c1f57600310675200a4023b9f84707c073dcd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2019 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -390,19 +390,15 @@ solib_aix_clear_solib (void)
 }
 
 /* Compute and return the OBJFILE's section_offset array, using
-   the associated loader info (INFO).
+   the associated loader info (INFO).  */
 
-   The resulting array is computed on the heap and must be
-   deallocated after use.  */
-
-static gdb::unique_xmalloc_ptr<struct section_offsets>
+static section_offsets
 solib_aix_get_section_offsets (struct objfile *objfile,
                               lm_info_aix *info)
 {
   bfd *abfd = objfile->obfd;
 
-  gdb::unique_xmalloc_ptr<struct section_offsets> offsets
-    (XCNEWVEC (struct section_offsets, objfile->num_sections));
+  section_offsets offsets (objfile->section_offsets.size ());
 
   /* .text */
 
@@ -411,7 +407,7 @@ solib_aix_get_section_offsets (struct objfile *objfile,
       struct bfd_section *sect
        = objfile->sections[objfile->sect_index_text].the_bfd_section;
 
-      offsets->offsets[objfile->sect_index_text]
+      offsets[objfile->sect_index_text]
        = info->text_addr + sect->filepos - bfd_section_vma (sect);
     }
 
@@ -422,7 +418,7 @@ solib_aix_get_section_offsets (struct objfile *objfile,
       struct bfd_section *sect
        = objfile->sections[objfile->sect_index_data].the_bfd_section;
 
-      offsets->offsets[objfile->sect_index_data]
+      offsets[objfile->sect_index_data]
        = info->data_addr - bfd_section_vma (sect);
     }
 
@@ -435,8 +431,8 @@ solib_aix_get_section_offsets (struct objfile *objfile,
   if (objfile->sect_index_bss != -1
       && objfile->sect_index_data != -1)
     {
-      offsets->offsets[objfile->sect_index_bss]
-       = (offsets->offsets[objfile->sect_index_data]
+      offsets[objfile->sect_index_bss]
+       = (offsets[objfile->sect_index_data]
           + solib_aix_bss_data_overlap (abfd));
     }
 
@@ -468,10 +464,10 @@ solib_aix_solib_create_inferior_hook (int from_tty)
   lm_info_aix &exec_info = (*library_list)[0];
   if (symfile_objfile != NULL)
     {
-      gdb::unique_xmalloc_ptr<struct section_offsets> offsets
+      section_offsets offsets
        = solib_aix_get_section_offsets (symfile_objfile, &exec_info);
 
-      objfile_relocate (symfile_objfile, offsets.get ());
+      objfile_relocate (symfile_objfile, offsets);
     }
 }
 
@@ -615,7 +611,7 @@ solib_aix_bfd_open (const char *pathname)
     (gdb_bfd_openr_next_archived_file (archive_bfd.get (), NULL));
   while (object_bfd != NULL)
     {
-      if (member_name == object_bfd->filename)
+      if (member_name == bfd_get_filename (object_bfd.get ()))
        break;
 
       object_bfd = gdb_bfd_openr_next_archived_file (archive_bfd.get (),
@@ -641,10 +637,10 @@ solib_aix_bfd_open (const char *pathname)
      along with appended parenthesized member name in order to allow commands
      listing all shared libraries to display.  Otherwise, we would only be
      displaying the name of the archive member object.  */
-  bfd_set_filename (object_bfd.get (),
-                   xstrprintf ("%s%s",
-                               bfd_get_filename (archive_bfd.get ()),
-                               sep));
+  std::string fname = string_printf ("%s%s",
+                                    bfd_get_filename (archive_bfd.get ()),
+                                    sep);
+  bfd_set_filename (object_bfd.get (), fname.c_str ());
 
   return object_bfd;
 }
@@ -723,8 +719,9 @@ show_solib_aix_debug (struct ui_file *file, int from_tty,
 /* The target_so_ops for AIX targets.  */
 struct target_so_ops solib_aix_so_ops;
 
+void _initialize_solib_aix ();
 void
-_initialize_solib_aix (void)
+_initialize_solib_aix ()
 {
   solib_aix_so_ops.relocate_section_addresses
     = solib_aix_relocate_section_addresses;
This page took 0.029299 seconds and 4 git commands to generate.