/* Link map info to include in an allocated so_list entry. */
struct lm_info_frv : public lm_info_base
+{
+ ~lm_info_frv ()
{
- /* The loadmap, digested into an easier to use form. */
- struct int_elf32_fdpic_loadmap *map;
- /* The GOT address for this link map entry. */
- CORE_ADDR got_value;
- /* The link map address, needed for frv_fetch_objfile_link_map(). */
- CORE_ADDR lm_addr;
-
- /* Cached dynamic symbol table and dynamic relocs initialized and
- used only by find_canonical_descriptor_in_load_object().
-
- Note: kevinb/2004-02-26: It appears that calls to
- bfd_canonicalize_dynamic_reloc() will use the same symbols as
- those supplied to the first call to this function. Therefore,
- it's important to NOT free the asymbol ** data structure
- supplied to the first call. Thus the caching of the dynamic
- symbols (dyn_syms) is critical for correct operation. The
- caching of the dynamic relocations could be dispensed with. */
- asymbol **dyn_syms;
- arelent **dyn_relocs;
- int dyn_reloc_count; /* Number of dynamic relocs. */
-
- };
+ xfree (this->map);
+ xfree (this->dyn_syms);
+ xfree (this->dyn_relocs);
+ }
+
+ /* The loadmap, digested into an easier to use form. */
+ int_elf32_fdpic_loadmap *map = NULL;
+ /* The GOT address for this link map entry. */
+ CORE_ADDR got_value = 0;
+ /* The link map address, needed for frv_fetch_objfile_link_map(). */
+ CORE_ADDR lm_addr = 0;
+
+ /* Cached dynamic symbol table and dynamic relocs initialized and
+ used only by find_canonical_descriptor_in_load_object().
+
+ Note: kevinb/2004-02-26: It appears that calls to
+ bfd_canonicalize_dynamic_reloc() will use the same symbols as
+ those supplied to the first call to this function. Therefore,
+ it's important to NOT free the asymbol ** data structure
+ supplied to the first call. Thus the caching of the dynamic
+ symbols (dyn_syms) is critical for correct operation. The
+ caching of the dynamic relocations could be dispensed with. */
+ asymbol **dyn_syms = NULL;
+ arelent **dyn_relocs = NULL;
+ int dyn_reloc_count = 0; /* Number of dynamic relocs. */
+};
/* The load map, got value, etc. are not available from the chain
of loaded shared objects. ``main_executable_lm_info'' provides
/* Implement the "open_symbol_file_object" target_so_ops method. */
static int
-open_symbol_file_object (void *from_ttyp)
+open_symbol_file_object (int from_tty)
{
/* Unimplemented. */
return 0;
}
sop = XCNEW (struct so_list);
- lm_info_frv *li = XCNEW (lm_info_frv);
+ lm_info_frv *li = new lm_info_frv;
sop->lm_info = li;
li->map = loadmap;
li->got_value = got_addr;
if (ldm == NULL)
error (_("Unable to load the executable's loadmap."));
- if (main_executable_lm_info)
- xfree (main_executable_lm_info);
- main_executable_lm_info = XCNEW (lm_info_frv);
+ delete main_executable_lm_info;
+ main_executable_lm_info = new lm_info_frv;
main_executable_lm_info->map = ldm;
new_offsets = XCNEWVEC (struct section_offsets,
lm_base_cache = 0;
enable_break2_done = 0;
main_lm_addr = 0;
- if (main_executable_lm_info != 0)
- {
- xfree (main_executable_lm_info->map);
- xfree (main_executable_lm_info->dyn_syms);
- xfree (main_executable_lm_info->dyn_relocs);
- xfree (main_executable_lm_info);
- main_executable_lm_info = 0;
- }
+
+ delete main_executable_lm_info;
+ main_executable_lm_info = NULL;
}
static void
{
lm_info_frv *li = (lm_info_frv *) so->lm_info;
- xfree (li->map);
- xfree (li->dyn_syms);
- xfree (li->dyn_relocs);
- xfree (li);
+ delete li;
}
static void
struct target_so_ops frv_so_ops;
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_frv_solib;
-
void
_initialize_frv_solib (void)
{