+2017-04-28 Simon Marchi <simon.marchi@ericsson.com>
+
+ * solib-darwin.c (struct darwin_so_list): Remove.
+ (darwin_current_sos): Allocate an so_list object instead of a
+ darwin_so_list, separately allocate an lm_info object.
+ (darwin_free_so): Free lm_info.
+
2017-04-28 John Baldwin <jhb@FreeBSD.org>
* mips-tdep.c (print_gp_register_row): Replace printf_filtered
CORE_ADDR lm_addr;
};
-struct darwin_so_list
-{
- /* Common field. */
- struct so_list sl;
- /* Darwin specific data. */
- struct lm_info li;
-};
-
/* Lookup the value for a specific symbol. */
static CORE_ADDR
unsigned long hdr_val;
char *file_path;
int errcode;
- struct darwin_so_list *dnew;
struct so_list *newobj;
struct cleanup *old_chain;
break;
/* Create and fill the new so_list element. */
- dnew = XCNEW (struct darwin_so_list);
- newobj = &dnew->sl;
- old_chain = make_cleanup (xfree, dnew);
+ newobj = XCNEW (struct so_list);
+ old_chain = make_cleanup (xfree, newobj);
- newobj->lm_info = &dnew->li;
+ newobj->lm_info = XCNEW (struct lm_info);
strncpy (newobj->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1);
newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
static void
darwin_free_so (struct so_list *so)
{
+ xfree (so->lm_info);
}
/* The section table is built from bfd sections using bfd VMAs.