Make the assembler generate an error if there is an attempt to define a section with...
[deliverable/binutils-gdb.git] / gdb / solib-target.c
index 3fd180850c14cf0ae8fc151b94966772c4968a8d..e90107e578256f3ea5a9969e9855f6b5c5e00036 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for targets which report shared library events.
 
-   Copyright (C) 2007-2019 Free Software Foundation, Inc.
+   Copyright (C) 2007-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,7 +23,6 @@
 #include "symtab.h"
 #include "symfile.h"
 #include "target.h"
-#include "gdbsupport/vec.h"
 #include "solib-target.h"
 #include <vector>
 
@@ -47,7 +46,7 @@ struct lm_info_target : public lm_info_base
 
   /* The cached offsets for each section of this shared library,
      determined from SEGMENT_BASES, or SECTION_BASES.  */
-  section_offsets *offsets = NULL;
+  gdb::unique_xmalloc_ptr<section_offsets> offsets;
 };
 
 typedef std::vector<std::unique_ptr<lm_info_target>> lm_info_vector;
@@ -310,9 +309,8 @@ solib_target_relocate_section_addresses (struct so_list *so,
     {
       int num_sections = gdb_bfd_count_sections (so->abfd);
 
-      li->offsets
-       = ((struct section_offsets *)
-          xzalloc (SIZEOF_N_SECTION_OFFSETS (num_sections)));
+      li->offsets.reset ((struct section_offsets *)
+                        xzalloc (SIZEOF_N_SECTION_OFFSETS (num_sections)));
 
       if (!li->section_bases.empty ())
        {
@@ -378,7 +376,8 @@ Could not relocate shared library \"%s\": no segments"), so->so_name);
              ULONGEST orig_delta;
              int i;
 
-             if (!symfile_map_offsets_to_segments (so->abfd, data, li->offsets,
+             if (!symfile_map_offsets_to_segments (so->abfd, data,
+                                                   li->offsets.get (),
                                                    li->segment_bases.size (),
                                                    li->segment_bases.data ()))
                warning (_("\
This page took 0.026976 seconds and 4 git commands to generate.