auto *li = gdb::checked_static_cast<lm_info_frv *> (so->lm_info.get ());
addr = find_canonical_descriptor_in_load_object
- (entry_point, got_value, name, so->abfd, li);
+ (entry_point, got_value, name, so->abfd.get (), li);
if (addr != 0)
break;
rocm_solib_relocate_section_addresses (so_list &so,
struct target_section *sec)
{
- if (!is_amdgpu_arch (gdbarch_from_bfd (so.abfd)))
+ if (!is_amdgpu_arch (gdbarch_from_bfd (so.abfd.get ())))
{
svr4_so_ops.relocate_section_addresses (so, sec);
return;
it any earlier, since we need to open the file first. */
if (li->offsets.empty ())
{
- int num_sections = gdb_bfd_count_sections (so.abfd);
+ int num_sections = gdb_bfd_count_sections (so.abfd.get ());
li->offsets.assign (num_sections, 0);
else if (!li->segment_bases.empty ())
{
symfile_segment_data_up data
- = get_symfile_segment_data (so.abfd);
+ = get_symfile_segment_data (so.abfd.get ());
if (data == NULL)
warning (_("\
ULONGEST orig_delta;
int i;
- if (!symfile_map_offsets_to_segments (so.abfd, data.get (),
+ if (!symfile_map_offsets_to_segments (so.abfd.get (), data.get (),
li->offsets,
li->segment_bases.size (),
li->segment_bases.data ()))
return 0;
/* Leave bfd open, core_xfer_memory and "info files" need it. */
- so.abfd = abfd.release ();
+ so.abfd = std::move (abfd);
/* Copy the full path name into so_name, allowing symbol_file_add
to find it later. This also affects the =library-loaded GDB/MI
the library's host-side path. If we let the target dictate
that objfile's path, and the target is different from the host,
GDB/MI will not provide the correct host-side path. */
- if (strlen (bfd_get_filename (so.abfd)) >= SO_NAME_MAX_PATH_SIZE)
+ if (strlen (bfd_get_filename (so.abfd.get ())) >= SO_NAME_MAX_PATH_SIZE)
error (_("Shared library file name is too long."));
- strcpy (so.so_name, bfd_get_filename (so.abfd));
+ strcpy (so.so_name, bfd_get_filename (so.abfd.get ()));
- so.sections = build_section_table (so.abfd);
+ so.sections = build_section_table (so.abfd.get ());
for (target_section &p : so.sections)
{
const target_so_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
this->sections.clear ();
-
- gdb_bfd_unref (this->abfd);
this->abfd = nullptr;
/* Our caller closed the objfile, possibly via objfile_purge_solibs. */
{
section_addr_info sap
= build_section_addr_info_from_section_table (so.sections);
- gdb_bfd_ref_ptr tmp_bfd
- (gdb_bfd_ref_ptr::new_reference (so.abfd));
+ gdb_bfd_ref_ptr tmp_bfd = so.abfd;
so.objfile = symbol_file_add_from_bfd (tmp_bfd, so.so_name,
flags, &sap,
OBJF_SHARED, NULL);
current_sos must initialize these fields to 0. */
- bfd *abfd = nullptr;
+ gdb_bfd_ref_ptr abfd;
char symbols_loaded = 0; /* flag: symbols read in yet? */
/* objfile with symbols for a loaded library. Target memory is read from