- Fix iBCS2 emulation of COFF files that have multiple libraries

in their library (STYP_LIB) section.
 - Attempt to make the code which calculates the next entry and
   string offsets look clearer.

PR:		kern/42580
Tested by:	Olaf Klein <ok@adimus.de> (on 4.7-PRERELEASE)
This commit is contained in:
robert 2002-09-09 15:51:10 +00:00
parent bdb08fa9d1
commit 21c03c95c8

View File

@ -389,11 +389,15 @@ exec_coff_imgact(imgp)
M_TEMP, M_WAITOK);
strcpy(libbuf, ibcs2_emul_path);
for (j = off; j < scns[i].s_size + off; j++) {
for (j = off; j < scns[i].s_size + off;) {
long stroff, nextoff;
char *libname;
libname = buf + j + 4 * *(long*)(buf + j + 4);
j += 4* *(long*)(buf + j);
nextoff = 4 * *(long *)(buf + j);
stroff = 4 * *(long *)(buf + j + sizeof(long));
libname = buf + j + stroff;
j += nextoff;
DPRINTF(("%s(%d): shared library %s\n",
__FILE__, __LINE__, libname));