pcc@frame.UUCP (Camden Clarke) (04/26/91)
Running AIX 3.1.5 (aka 3.1 with the 3005 update applied). I've been using '/usr/ucb/nm' (BSD nm) to examine the supplied X libraries, and I'm getting results that I can't explain. Does anyone know why this happens?: % /usr/ucb/nm libX11.a | grep XOpenDisplay 0000c210 T .XOpenDisplay 00006e6c D XOpenDisplay % % /usr/ucb/nm libXt.a | grep XOpenDisplay U XOpenDisplay 000041c4 T .XOpenDisplay 000041c4 t .XOpenDisplay 00008938 d XOpenDisplay % % /usr/ucb/nm libdps.a | grep XOpenDisplay U XOpenDisplay 0000be60 T .XOpenDisplay 0000be60 t .XOpenDisplay 0000d5b0 d XOpenDisplay It looks to me like there are three copies of XOpenDisplay, one in each library, but I don't think that's really the case. My best guess is that this is caused by shared libraries. (And speaking of shared libraries, where is a good place to start reading in info to understand AIX shared libraries? Can you link a binary without shared libraries, like -Bstatic under SunOS?) Any help would be appreciated. -Cam Clarke Frame Technology cclarke@frame.com OR pcc@frame.com
marc@stingray.austin.ibm.com (Marc J. Stephenson/140000;1C-22) (05/09/91)
In article <19722@frame.UUCP> pcc@frame.com (Camden Clarke) writes: >Running AIX 3.1.5 (aka 3.1 with the 3005 update applied). >I've been using '/usr/ucb/nm' (BSD nm) to examine the supplied X libraries, >and I'm getting results that I can't explain... > % /usr/ucb/nm libX11.a | grep XOpenDisplay > 0000c210 T .XOpenDisplay > 00006e6c D XOpenDisplay > % /usr/ucb/nm libXt.a | grep XOpenDisplay > U XOpenDisplay > 000041c4 T .XOpenDisplay > 000041c4 t .XOpenDisplay > 00008938 d XOpenDisplay > % /usr/ucb/nm libdps.a | grep XOpenDisplay > [ basically same results as for libXt... ] >It looks to me like there are three copies of XOpenDisplay, one in each >library, but I don't think that's really the case. My best guess is that >this is caused by shared libraries. (And speaking of shared libraries, >where is a good place to start reading in info to understand AIX shared >libraries? Can you link a binary without shared libraries, like -Bstatic >under SunOS?) Any help would be appreciated. -Cam Clarke You are correct in assuming that there is really only one copy of XOpenDisplay - in libX11.a. The symbols from the other two libraries are linkage routine symbols - calls from within those libraries to XOpenDisplay() go through a linkage routine (glink.s) which handles the "out-of-module" call, basically indirectly. The linker and the loader take care of the details. A better way than /usr/ucb/nm to look at the information is dump -tv; /usr/ucb/nm seems to lack the granularity or functionality to discern the differences (dump -tv dumps the symbol table in a somewhat readable fashion, at least more detailed). You can indeed link unshared via the linker option -b nso. If you try to link libc.a unshared, you still have to import the system calls, though, as in cc hello.c -bnso -bimport:/lib/syscalls.exp. As for where to read about shared libs, I'm not sure where the best place to look in info would be (I haven't had time to check in there). I used "man ld" to get the linker flag information. Sorry. If I get time, I'll look around. -- Marc Stephenson IBM PSPA (Personal System Programming - Austin,TX) DISCLAIMER: The content of this posting is independent of official IBM position. marc@stingray.austin.ibm.com VNET: MARC at AUSVMQ IBM T/L: 793-3796