Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 1996 01:35:58 -0800 (PST)
From:      John-Mark Gurney <jmg@nike.efn.org>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        FreeBSD hackers <freebsd-hackers@freebsd.org>
Subject:   Re: ok...  my real problem...
Message-ID:  <Pine.NEB.3.95.961129012525.12656O-100000@nike>
In-Reply-To: <199611290913.KAA25930@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.961129012525.12656O-100000>