/*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/

#include <stdio.h>
#include <dlfcn.h>

extern int fib(int);
extern void shared_hello(void);

int
main()
{
	void *freston;
	void *girlfriend;

	shared_hello();
	printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5));

	freston= dlopen("/boot/lib/girlfriend.so", RTLD_NOW);
	girlfriend= dlsym(freston, "girlfriend");

	((void(*)(void))girlfriend)();

	return 0;
}

/*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/

#include <stdio.h>
#include <dlfcn.h>

extern int fib(int);
extern void shared_hello(void);

int
main()
{
	void *freston;
	void *girlfriend;

	shared_hello();
	printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5));

	freston= dlopen("/boot/lib/girlfriend.so", RTLD_LAZY);
	girlfriend= dlsym(freston, "girlfriend");

	((void(*)(void))girlfriend)();

	return 0;
}

--- 
+++ 
@@ -18,7 +18,7 @@
 	shared_hello();
 	printf("%d %d %d %d %d %d\n", fib(0), fib(1), fib(2), fib(3), fib(4), fib(5));
 
-	freston= dlopen("/boot/lib/girlfriend.so", RTLD_LAZY);
+	freston= dlopen("/boot/lib/girlfriend.so", RTLD_NOW);
 	girlfriend= dlsym(freston, "girlfriend");
 
 	((void(*)(void))girlfriend)();
Fix serious bug. Should be RTLD_NOW... RTLD_LAZY does not work for getting a girlfriend.


git-svn-id: fb278a52ad97f7fbef074986829f2c6a2a3c4b34@547 c25cc9d1-44fa-0310-b259-ad778cb1d433
