2
0

elfload32.c 869 B

123456789101112131415161718192021222324252627282930
  1. #define TARGET_ABI32
  2. #define load_elf_binary load_elf_binary32
  3. #define do_init_thread do_init_thread32
  4. #include "elfload.c"
  5. #undef load_elf_binary
  6. #undef do_init_thread
  7. int load_elf_binary(struct linux_binprm *bprm, struct target_pt_regs *regs,
  8. struct image_info *info);
  9. int load_elf_binary_multi(struct linux_binprm *bprm,
  10. struct target_pt_regs *regs,
  11. struct image_info *info)
  12. {
  13. struct elfhdr *elf_ex;
  14. int retval;
  15. elf_ex = (struct elfhdr *) bprm->buf; /* exec-header */
  16. if (elf_ex->e_ident[EI_CLASS] == ELFCLASS64) {
  17. retval = load_elf_binary(bprm, regs, info);
  18. } else {
  19. retval = load_elf_binary32(bprm, regs, info);
  20. if (personality(info->personality) == PER_LINUX)
  21. info->personality = PER_LINUX32;
  22. }
  23. return retval;
  24. }