root / linux-user / elfload32.c @ 94909d9f
History | View | Annotate | Download (869 Bytes)
1 |
#define TARGET_ABI32
|
---|---|
2 |
#define load_elf_binary load_elf_binary32
|
3 |
#define do_init_thread do_init_thread32
|
4 |
|
5 |
#include "elfload.c" |
6 |
|
7 |
#undef load_elf_binary
|
8 |
#undef do_init_thread
|
9 |
|
10 |
int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs, |
11 |
struct image_info *info);
|
12 |
|
13 |
int load_elf_binary_multi(struct linux_binprm *bprm, |
14 |
struct target_pt_regs *regs,
|
15 |
struct image_info *info)
|
16 |
{ |
17 |
struct elfhdr *elf_ex;
|
18 |
int retval;
|
19 |
|
20 |
elf_ex = (struct elfhdr *) bprm->buf; /* exec-header */ |
21 |
if (elf_ex->e_ident[EI_CLASS] == ELFCLASS64) {
|
22 |
retval = load_elf_binary(bprm, regs, info); |
23 |
} else {
|
24 |
retval = load_elf_binary32(bprm, regs, info); |
25 |
if (personality(info->personality) == PER_LINUX)
|
26 |
info->personality = PER_LINUX32; |
27 |
} |
28 |
|
29 |
return retval;
|
30 |
} |