diff options
Diffstat (limited to 'sys/i386/ibcs2')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_util.c | 2 | ||||
-rw-r--r-- | sys/i386/ibcs2/imgact_coff.c | 44 |
2 files changed, 27 insertions, 19 deletions
diff --git a/sys/i386/ibcs2/ibcs2_util.c b/sys/i386/ibcs2/ibcs2_util.c index ce1e0e4..3f7cb2a 100644 --- a/sys/i386/ibcs2/ibcs2_util.c +++ b/sys/i386/ibcs2/ibcs2_util.c @@ -43,7 +43,7 @@ #include <i386/ibcs2/ibcs2_util.h> -const char ibcs2_emul_path[] = "/emul/ibcs2"; +const char ibcs2_emul_path[] = "/compat/ibcs2"; /* * Search an alternate path before passing pathname arguments on diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c index 2318f7d..31c8ecf 100644 --- a/sys/i386/ibcs2/imgact_coff.c +++ b/sys/i386/ibcs2/imgact_coff.c @@ -53,7 +53,6 @@ extern int exec_coff_imgact __P((struct image_params *iparams)); static int load_coff_section __P((struct vmspace *vmspace, struct vnode *vp, vm_offset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot)); - static int load_coff_section(vmspace, vp, offset, vmaddr, memsz, filsz, prot) struct vmspace *vmspace; @@ -380,23 +379,32 @@ exec_coff_imgact(iparams) foff)) { return ENOEXEC; } - for (j = off; j < scns[i].s_size + off; j++) { - char *libname; - char libbuf[40]; - - libname = buf + j + 4 * *(long*)(buf + j + 4); - j += 4* *(long*)(buf + j); - - DPRINTF(("%s(%d): shared library %s\n", - __FILE__, __LINE__, libname)); - strcpy(libbuf, "/emul/ibcs2"); - strcpy(&libbuf[11], libname); - error = coff_load_file(iparams->proc, libbuf); - if (error) - error = coff_load_file(iparams->proc, libname); - if (error) - break; - } + if(scns[i].s_size) { + char *libbuf; + int emul_path_len = strlen(ibcs2_emul_path); + + libbuf = malloc(MAXPATHLEN + emul_path_len, + M_TEMP, M_WAITOK); + strcpy(libbuf, ibcs2_emul_path); + + for (j = off; j < scns[i].s_size + off; j++) { + char *libname; + + libname = buf + j + 4 * *(long*)(buf + j + 4); + j += 4* *(long*)(buf + j); + + DPRINTF(("%s(%d): shared library %s\n", + __FILE__, __LINE__, libname)); + strcpy(&libbuf[emul_path_len], libname); + error = coff_load_file(iparams->proc, libbuf); + if (error) + error = coff_load_file(iparams->proc, + libname); + if (error) + break; + } + free(libbuf, M_TEMP); + } if (vm_map_remove(kernel_map, (vm_offset_t) buf, (vm_offset_t) buf + len)) |