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