From owner-freebsd-hackers Fri Nov 29 01:37:09 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA11535 for hackers-outgoing; Fri, 29 Nov 1996 01:37:09 -0800 (PST) Received: from nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA11528 for ; Fri, 29 Nov 1996 01:37:05 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by nike.efn.org (8.8.3/8.8.3) with SMTP id BAA12822; Fri, 29 Nov 1996 01:35:58 -0800 (PST) Date: Fri, 29 Nov 1996 01:35:58 -0800 (PST) From: John-Mark Gurney X-Sender: jmg@nike Reply-To: John-Mark Gurney To: Joerg Wunsch cc: FreeBSD hackers Subject: Re: ok... my real problem... In-Reply-To: <199611290913.KAA25930@uriah.heep.sax.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 29 Nov 1996, J Wunsch wrote: > As John-Mark Gurney wrote: > > > now the problem is that even though the proper object files are listed > > first in the .a file.. when ld links it with the rest of the program it > > doesn't see the .a's reference to it's self.. I even tried to add the lib > > twice but still no go... > > I'm not sure whether i understand your problem or not, but is it > possible that you forgot to ranlib(1) your library? well... bsd.lib.mk does run ranlib on it doesn't it? also... all of these libs are made with bsd.lib.mk... just so you know... well.. here is some more info: nm on my libmyutil.a: genconvert.o: U _LLADDNODE U _asprintf U _calloc 0000000c T _checkfunct U _dlsym 0000005c T _findconvfunct U _free U _malloc fdprintf.o: 00000000 T _fdprintf U _free U _vasprintf U _write linklist.o: 00000038 T _LLADDDATA 00000000 T _LLADDNODE 00000068 T _LLREMOVE U _calloc and the nm on libmain.so.1.0 that links the above lib static: 000009b8 T _LLADDDATA 00000980 T _LLADDNODE 000009e8 T _LLREMOVE 00002000 C __DYNAMIC 00002060 D __GLOBAL_OFFSET_TABLE_ 0000076c T _checkfunct 00000020 T _donothing 00002120 D _edata 00002120 B _end 00001060 T _etext 000008f0 T _fdprintf 000007bc T _findconvfunct 00000148 T _main 00000560 T _setup_socket 00000710 T _update_mainlibconf this may look normal but I get this output when I make libmain.so.1.0: building shared main library (version 1.0) ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x8dd for "_free" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x8d1 for "_free" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x8b8 for "_LLADDNODE" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x7d4 for "_malloc" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x7c7 for "_calloc" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x7a9 for "_free" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x798 for "_dlsym" ld: ../../libmyutil/libmyutil.a(genconvert.o): RRS text relocation at 0x788 for "_asprintf" ld: ../../libmyutil/libmyutil.a(fdprintf.o): RRS text relocation at 0x961 for "_free" ld: ../../libmyutil/libmyutil.a(fdprintf.o): RRS text relocation at 0x94b for "_write" ld: ../../libmyutil/libmyutil.a(fdprintf.o): RRS text relocation at 0x910 for "_vasprintf" ld: ../../libmyutil/libmyutil.a(linklist.o): RRS text relocation at 0x9c3 for "_calloc" now most of those are fine... as they are common calls... but the line shows that it isn't linking the lib static... now I haven't actually used any of these routines so every thing could work out fine... but the reason I'm conserned is because this lib isn't a "normal" share lib... I'm using it with a program that I wrote that loads it with dlopen... and does calles with dlsym... of course this could all "just work".. it's just that I haven't added all the code to glue the parts together and it's worrying me.. oh... I just realized that you might find it useful to see the output of nm on the object files in libmain.so.1.0: convert.so: U __GLOBAL_OFFSET_TABLE_ U _findconvfunct 00000010 T _update_mainlibconf main.so: U __GLOBAL_OFFSET_TABLE_ U ___main U _accept U _bzero U _close 00000000 T _donothing U _exit U _fcntl U _fdprintf U _free 00000128 T _main U _malloc U _select U _setproctitle U _setup_socket U _signal U _strdup U _syslog U _update_mainlibconf socketstuff.so: U __GLOBAL_OFFSET_TABLE_ U _bind U _fcntl U _getsockname U _listen U _setsockopt 000000d0 T _setup_socket U _socket U _syslog as you can see it resolves the call to fdprintf without any problems... it's just not or seems to not resolve the call to _LLADDNODE even though it does exist... hope this helps... ttyl.. John-Mark gurney_j@efn.org http://resnet.uoregon.edu/~gurney_j/ Modem/FAX: (541) 683-6954 (FreeBSD Box) Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)