Revision 7267c094 linux-user/elfload.c
b/linux-user/elfload.c | ||
---|---|---|
1473 | 1473 |
#ifdef CONFIG_USE_FDPIC |
1474 | 1474 |
{ |
1475 | 1475 |
struct elf32_fdpic_loadseg *loadsegs = info->loadsegs = |
1476 |
qemu_malloc(sizeof(*loadsegs) * info->nsegs);
|
|
1476 |
g_malloc(sizeof(*loadsegs) * info->nsegs);
|
|
1477 | 1477 |
|
1478 | 1478 |
for (i = 0; i < ehdr->e_phnum; ++i) { |
1479 | 1479 |
switch (phdr[i].p_type) { |
... | ... | |
2063 | 2063 |
{ |
2064 | 2064 |
struct mm_struct *mm; |
2065 | 2065 |
|
2066 |
if ((mm = qemu_malloc(sizeof (*mm))) == NULL)
|
|
2066 |
if ((mm = g_malloc(sizeof (*mm))) == NULL)
|
|
2067 | 2067 |
return (NULL); |
2068 | 2068 |
|
2069 | 2069 |
mm->mm_count = 0; |
... | ... | |
2078 | 2078 |
|
2079 | 2079 |
while ((vma = vma_first(mm)) != NULL) { |
2080 | 2080 |
QTAILQ_REMOVE(&mm->mm_mmap, vma, vma_link); |
2081 |
qemu_free(vma);
|
|
2081 |
g_free(vma);
|
|
2082 | 2082 |
} |
2083 |
qemu_free(mm);
|
|
2083 |
g_free(mm);
|
|
2084 | 2084 |
} |
2085 | 2085 |
|
2086 | 2086 |
static int vma_add_mapping(struct mm_struct *mm, abi_ulong start, |
... | ... | |
2088 | 2088 |
{ |
2089 | 2089 |
struct vm_area_struct *vma; |
2090 | 2090 |
|
2091 |
if ((vma = qemu_mallocz(sizeof (*vma))) == NULL)
|
|
2091 |
if ((vma = g_malloc0(sizeof (*vma))) == NULL)
|
|
2092 | 2092 |
return (-1); |
2093 | 2093 |
|
2094 | 2094 |
vma->vma_start = start; |
... | ... | |
2412 | 2412 |
TaskState *ts = (TaskState *)env->opaque; |
2413 | 2413 |
struct elf_thread_status *ets; |
2414 | 2414 |
|
2415 |
ets = qemu_mallocz(sizeof (*ets));
|
|
2415 |
ets = g_malloc0(sizeof (*ets));
|
|
2416 | 2416 |
ets->num_notes = 1; /* only prstatus is dumped */ |
2417 | 2417 |
fill_prstatus(&ets->prstatus, ts, 0); |
2418 | 2418 |
elf_core_copy_regs(&ets->prstatus.pr_reg, env); |
... | ... | |
2436 | 2436 |
|
2437 | 2437 |
QTAILQ_INIT(&info->thread_list); |
2438 | 2438 |
|
2439 |
info->notes = qemu_mallocz(NUMNOTES * sizeof (struct memelfnote));
|
|
2439 |
info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));
|
|
2440 | 2440 |
if (info->notes == NULL) |
2441 | 2441 |
return (-ENOMEM); |
2442 |
info->prstatus = qemu_mallocz(sizeof (*info->prstatus));
|
|
2442 |
info->prstatus = g_malloc0(sizeof (*info->prstatus));
|
|
2443 | 2443 |
if (info->prstatus == NULL) |
2444 | 2444 |
return (-ENOMEM); |
2445 |
info->psinfo = qemu_mallocz(sizeof (*info->psinfo));
|
|
2445 |
info->psinfo = g_malloc0(sizeof (*info->psinfo));
|
|
2446 | 2446 |
if (info->prstatus == NULL) |
2447 | 2447 |
return (-ENOMEM); |
2448 | 2448 |
|
... | ... | |
2483 | 2483 |
while (!QTAILQ_EMPTY(&info->thread_list)) { |
2484 | 2484 |
ets = QTAILQ_FIRST(&info->thread_list); |
2485 | 2485 |
QTAILQ_REMOVE(&info->thread_list, ets, ets_link); |
2486 |
qemu_free(ets);
|
|
2486 |
g_free(ets);
|
|
2487 | 2487 |
} |
2488 | 2488 |
|
2489 |
qemu_free(info->prstatus);
|
|
2490 |
qemu_free(info->psinfo);
|
|
2491 |
qemu_free(info->notes);
|
|
2489 |
g_free(info->prstatus);
|
|
2490 |
g_free(info->psinfo);
|
|
2491 |
g_free(info->notes);
|
|
2492 | 2492 |
} |
2493 | 2493 |
|
2494 | 2494 |
static int write_note_info(struct elf_note_info *info, int fd) |
Also available in: Unified diff