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
(which is probably a symbolic link to was stripped. 
try this.  My system is RedHat 7.3

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

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

Notice, from the output of the file command, that was
stripped but was not.

Although if you have a .o file that calls say XRRCloseDisplay and you
link that against the link will succeed. ie, the linker
can tell what offset in 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.


On Tue, 2003-10-28 at 00:51, flemingb wrote:
> Regarding this post
> 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 | grep "XRRSetScreenAndConfigRate" i get
> nm: 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]