On Fri, 7 Oct 2011 00:36:34 +0200, Adam Lackorzynski wrote:
Ok, try it.
So, I tried to link the libdl as a static library to my program, and load my shared lib with dlopen(). It almost worked, but I got many unresolved symbols when loading the library. So, I tried to add the missing static libs when linking my shared lib. As I understood, when linking shared libs, I should link it with libs with '.p' suffix. But not all libs have their counterparts with '.p' suffix. I added these libs:
LIBS = -los2exec -los2fs -los2server -lloaderif.p -levents -llist_alloc.p -lgeneric_fprov.p \ -ldemangle.p -ll4rm.p -ldm_mem.p -ldm_generic.p -lthread.p -lsemaphore.p -ll4env.p -ll4env_err.p\ -lslab.p -llogserver_capsule.p -ll4rm.p -lthread.p -ldm_generic.p -lnames.p -ll4util_root.p -ll4util.p \ -lsigma0.p -lroot.p -ll4sys.p -nostdlib -u printf -lc_be_io.o -u mmap_anon -lc_be_simple_mem.p \ -lc_be_time -lrtc.p -ll4rm.p -ldm_mem.p -ldm_generic.p -lthread.p -lsemaphore.p -ll4env.p -ll4env_err.p \ -lslab.p -llogserver_capsule.p -ll4rm.p -lthread.p -ldm_generic.p -lnames.p -ll4util_root.p -ll4util.p \ -lsigma0.p -luc_c $(GCCLIB) -u mmap_anon \ -lc_be_simple_mem.p -ll4rm.p -ldm_mem.p -ldm_generic.p -lc_be_time -lc_be_mmap.p -lc_be_mmap_util.p \ -lc_be_l4env_start_stop.p -lgeneric_ts.p -lc_be_syslog -lc_be_file-table -luc_be_simple_sleep \ -ll4vfs_common_io -ll4vfs_basic_io -ll4vfs_connection -ll4vfs_basic_name_server -ll4vfs_name_server \ -ll4vfs_name_space_provider -ll4vfs_extendable -ll4sys.p -luc_c -ll4util_root.p -lrtc.p
-- here, os2exec, os2fs and os2server are client libs for my servers. It seems that no need for client libs to make a version with '.p' suffix (i.e. to be linked with shared libs). But I still have some missing symbols, like 'main', 'crt0_tramppage' (the last should be in C startup code, but crt0.s.o has not it). Some libs, like 'events', have no a version with '.p' suffix. (I noticed that such libs are mostly libc backends).
What is the difference of libs with '.p' suffix from the libs without it? Should I make myself such versions for my libs (I use only client ones for my servers). And could anyone tell, what libs from the above list could reference symbols like 'main', 'crt0_tramppage'?
Thanks in advance, valery