Revision d691f669 linux-user/elfload.c
b/linux-user/elfload.c | ||
---|---|---|
42 | 42 |
#define DLINFO_ITEMS 12 |
43 | 43 |
|
44 | 44 |
/* Where we find X86 libraries... */ |
45 |
//#define X86_DEFAULT_LIB_DIR "/usr/x86/" |
|
46 |
#define X86_DEFAULT_LIB_DIR "/" |
|
45 |
|
|
47 | 46 |
|
48 | 47 |
//extern void * mmap4k(); |
49 | 48 |
#define mmap4k(a, b, c, d, e, f) mmap((void *)(a), b, c, d, e, f) |
... | ... | |
638 | 637 |
* is an a.out format binary |
639 | 638 |
*/ |
640 | 639 |
|
641 |
elf_interpreter = (char *)malloc(elf_ppnt->p_filesz+strlen(X86_DEFAULT_LIB_DIR)); |
|
640 |
elf_interpreter = (char *)malloc(elf_ppnt->p_filesz+ |
|
641 |
strlen(bprm->interp_prefix)); |
|
642 | 642 |
|
643 | 643 |
if (elf_interpreter == NULL) { |
644 | 644 |
free (elf_phdata); |
... | ... | |
646 | 646 |
return -ENOMEM; |
647 | 647 |
} |
648 | 648 |
|
649 |
strcpy(elf_interpreter, X86_DEFAULT_LIB_DIR);
|
|
649 |
strcpy(elf_interpreter, bprm->interp_prefix);
|
|
650 | 650 |
retval = lseek(bprm->fd, elf_ppnt->p_offset, SEEK_SET); |
651 | 651 |
if(retval >= 0) { |
652 | 652 |
retval = read(bprm->fd, |
653 |
elf_interpreter+strlen(X86_DEFAULT_LIB_DIR),
|
|
653 |
elf_interpreter+strlen(bprm->interp_prefix),
|
|
654 | 654 |
elf_ppnt->p_filesz); |
655 | 655 |
} |
656 | 656 |
if(retval < 0) { |
... | ... | |
911 | 911 |
|
912 | 912 |
|
913 | 913 |
|
914 |
int elf_exec(const char * filename, char ** argv, char ** envp, |
|
914 |
int elf_exec(const char *interp_prefix, |
|
915 |
const char * filename, char ** argv, char ** envp, |
|
915 | 916 |
struct target_pt_regs * regs, struct image_info *infop) |
916 | 917 |
{ |
917 | 918 |
struct linux_binprm bprm; |
... | ... | |
930 | 931 |
else { |
931 | 932 |
bprm.fd = retval; |
932 | 933 |
} |
934 |
bprm.interp_prefix = (char *)interp_prefix; |
|
933 | 935 |
bprm.filename = (char *)filename; |
934 | 936 |
bprm.sh_bang = 0; |
935 | 937 |
bprm.loader = 0; |
Also available in: Unified diff