Re: Grandr and libs problems



Hi Ben,

I'm not a real shared library guru but here is some information that
might be helpful to you.

When a shared library is built ( lib*.so is a shared library, lib*.a is
a static library ) a table that maps symbol names to hex offsets is
included in the file.  However this table can be stripped out to save
disk space.  (the command is called strip) My guess is that libXrandr.so
(which is probably a symbolic link to libXrandr.so.1.0??) was stripped. 
try this.  My system is RedHat 7.3

$ cd /usr/X11R6/libs
$ file libXrandr.so
libXrandr.so: symbolic link to libXrandr.so.1.0
$ file libXrandr.so.1.0
libXrandr.so.1.0: ELF 32-bit LSB shared object, Intel 80386, version 1
(SYSV), stripped
$ nm libXrandr.so.1.0
nm: libXrandr.so.1.0: no symbols
$ file libXrandr.so.2.0
libXrandr.so.2.0: ELF 32-bit LSB shared object, Intel 80386, version 1
(SYSV), not stripped
$ nm libXrandr.so.2.0
         U XFree
         U XMissingExtension
000010f0 t XRRCloseDisplay
00001238 T XRRConfigCurrentConfiguration
...

$ nm libXrandr.a
 
Xrandr.o:
         U XFree
         U XMissingExtension
000001d0 t XRRCloseDisplay
000003d0 T XRRCurrentConfig
....

Notice, from the output of the file command, that libXrandr.so.1.0 was
stripped but libXrandr.so.2.0 was not.

Although if you have a .o file that calls say XRRCloseDisplay and you
link that against libXrandr.so.1.0 the link will succeed. ie, the linker
can tell what offset in libXrandr.so.1.0 the code for XRRCloseDisplay
starts at.  I don't know how it does this.  If anyone else knows I'd
sure like to understand it!

Hope this helps.

Mike


On Tue, 2003-10-28 at 00:51, flemingb wrote:
> Regarding this post
> http://mail.gnome.org/archives/garnome-list/2003-July/msg00358.html on listing
> lib symbols using nm.
> I have the same problem (grandr_applet-0.2) won't compile because it says
> XRRSetScreenConfigAndRate is not defined. I have all the stuff. (btw, I am using
> RH9, gcc-3.2.2-5, XFree86-4.3.0-2, devel & libs)
> 
> When I go to /usr/XllR6/libs and do
> nm libXrandr.so | grep "XRRSetScreenAndConfigRate" i get
> nm: libXrandr.so: no symbols
> 
> however, when i type nm libXrandr.a | grep "XRRSetScreenConfigAndRate" i get
> 00000de0 T XRRSetScreenConfigAndRate
> 
> So what is the deal? What is set up wrong? (I'm pretty much a toddler in the
> woods) I thought I had a pretty standard install of Redhat. If anyone can help
> me, I would greatly appreciate it!
> Thanks,
> Ben



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]