gdb/
[deliverable/binutils-gdb.git] / gdb / elfread.c
index de61a9aa586dc0a03f99239d1747e514a999a4af..84efc594dcfc1ec525bce0cce7350f2cd67ec3e1 100644 (file)
@@ -205,7 +205,7 @@ record_minimal_symbol (const char *name, int name_len, int copy_name,
 
   if (ms_type == mst_text || ms_type == mst_file_text
       || ms_type == mst_text_gnu_ifunc)
-    address = gdbarch_smash_text_address (gdbarch, address);
+    address = gdbarch_addr_bits_remove (gdbarch, address);
 
   return prim_record_minimal_symbol_full (name, name_len, copy_name, address,
                                          ms_type, bfd_section->index,
@@ -353,7 +353,7 @@ elf_symtab_read (struct objfile *objfile, int type,
            }
          filesym = sym;
          filesymname = bcache (filesym->name, strlen (filesym->name) + 1,
-                               objfile->filename_cache);
+                               objfile->per_bfd->filename_cache);
        }
       else if (sym->flags & BSF_SECTION_SYM)
        continue;
@@ -570,7 +570,7 @@ elf_symtab_read (struct objfile *objfile, int type,
                elf_sym = (elf_symbol_type *) sym->udata.p;
 
              if (elf_sym)
-               MSYMBOL_SIZE(msym) = elf_sym->internal_elf_sym.st_size;
+               SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
 
              msym->filename = filesymname;
              gdbarch_elf_make_msymbol_special (gdbarch, sym, msym);
@@ -594,7 +594,7 @@ elf_symtab_read (struct objfile *objfile, int type,
                                                  sym->section, objfile);
                  if (mtramp)
                    {
-                     MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym);
+                     SET_MSYMBOL_SIZE (mtramp, MSYMBOL_SIZE (msym));
                      mtramp->created_by_gdb = 1;
                      mtramp->filename = filesymname;
                      gdbarch_elf_make_msymbol_special (gdbarch, sym, mtramp);
@@ -689,7 +689,7 @@ elf_rel_plt_read (struct objfile *objfile, asymbol **dyn_symbol_table)
                                     1, address, mst_slot_got_plt, got_plt,
                                    objfile);
       if (msym)
-       MSYMBOL_SIZE (msym) = ptr_size;
+       SET_MSYMBOL_SIZE (msym, ptr_size);
     }
 
   do_cleanups (back_to);
@@ -1109,7 +1109,7 @@ build_id_verify (const char *filename, struct build_id *check)
   int retval = 0;
 
   /* We expect to be silent on the non-existing files.  */
-  abfd = bfd_open_maybe_remote (filename);
+  abfd = gdb_bfd_open_maybe_remote (filename);
   if (abfd == NULL)
     return 0;
 
@@ -1445,10 +1445,12 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
 
       if (debugfile)
        {
+         struct cleanup *cleanup = make_cleanup (xfree, debugfile);
          bfd *abfd = symfile_bfd_open (debugfile);
 
+         make_cleanup_bfd_unref (abfd);
          symbol_file_add_separate (abfd, symfile_flags, objfile);
-         xfree (debugfile);
+         do_cleanups (cleanup);
        }
     }
 
This page took 0.025436 seconds and 4 git commands to generate.