diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-24 23:00:36 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-03-24 23:00:36 +0000 |
commit | 644c433cb3759599aa1440b412964f8e49cc0b71 (patch) | |
tree | 6e68d21c28cbdbacb0f97041f656b58a7b3c668f /linux-user/elfload.c | |
parent | d691f66983c0b36689400e9e9137d72bd3be8e72 (diff) | |
download | qemu-644c433cb3759599aa1440b412964f8e49cc0b71.zip qemu-644c433cb3759599aa1440b412964f8e49cc0b71.tar.gz qemu-644c433cb3759599aa1440b412964f8e49cc0b71.tar.bz2 |
ld.so load fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@47 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 817913d..386991a 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -360,9 +360,6 @@ static unsigned int * create_elf_tables(char *p, int argc, int envc, put_user (tswapl(val), dlinfo++) if (exec) { /* Put this here for an ELF program interpreter */ - struct elf_phdr * eppnt; - eppnt = (struct elf_phdr *)((unsigned long)exec->e_phoff); - NEW_AUX_ENT (AT_PHDR, (unsigned int)(load_addr + exec->e_phoff)); NEW_AUX_ENT (AT_PHENT, (unsigned int)(sizeof (struct elf_phdr))); NEW_AUX_ENT (AT_PHNUM, (unsigned int)(exec->e_phnum)); @@ -418,6 +415,9 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex, */ load_addr = INTERP_LOADADDR; +#ifdef BSWAP_NEEDED + bswap_ehdr(interp_elf_ex); +#endif /* First of all, some simple consistency checks */ if ((interp_elf_ex->e_type != ET_EXEC && interp_elf_ex->e_type != ET_DYN) || @@ -425,6 +425,7 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex, return ~0UL; } + /* Now read in all of the header information */ if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > X86_PAGE_SIZE) @@ -452,7 +453,6 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex, (char *) elf_phdata, sizeof(struct elf_phdr) * interp_elf_ex->e_phnum); } - if (retval < 0) { perror("load_elf_interp"); exit(-1); |