1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00

- 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 Drehmel 2002-09-09 15:51:10 +00:00
parent c19c8e606f
commit 4dfbdd7823
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103128

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));