Fix for NEXTSTEP shared libs with 0.8.3

Gregor Hoffleit flight at mathi.uni-heidelberg.DE
Sat Mar 22 05:13:55 PST 1997


Below is a fix for shared libs with NEXTSTEP 3.x and kaffe 0.8.3. The implementation in 0.8.3 failed for all but simple programs.

	Gregor



diff -urN /private/tmp/O_1_kaffe-0.8_3/kaffe-0.8.3/kaffe/kaffevm/slib.h ./kaffe/kaffevm/slib.h
--- /private/tmp/O_1_kaffe-0.8_3/kaffe-0.8.3/kaffe/kaffevm/slib.h	Wed Mar 19 09:42:33 1997
+++ ./kaffe/kaffevm/slib.h	Sat Mar 22 13:23:01 1997
@@ -36,10 +36,14 @@
 #define	LIBRARYLOAD(HAND, LIB)						\
 	{								\
 		const char* filenames[2];				\
 		struct mach_header* new_header;				\
 		filenames[0]=(LIB);					\
 		filenames[1]=NULL;					\
-		HAND = rld_load(NULL,&new_header,filenames,NULL);	\
+		if (rld_load(NULL,&new_header,filenames,NULL))	{	\
+			HAND = malloc(strlen(LIB)+1);			\
+			strcpy(LIB, HAND);				\
+		} else							\
+			HAND = 0;					\
 	}
 #define	LIBRARYFUNCTION(FUNC, SYM)					\
 	rld_lookup(NULL,SYM,&FUNC)


More information about the kaffe mailing list