Shared library? --Help

Shared library? --Help

Post by Shuguang Li » Wed, 04 Oct 1995 04:00:00

Hello, I recently installed X from the xap disks of slackware downloaded
from sunsite.unc. However, I could not start seyon from an xterm window.
The error msg if as follows:

       /usr/X11R6/lib/ is not an ELF file.
       Unable to load shared library

Does anybody know what is going on? I have read some related Howto's and
books, but so far have not had any clue. Help is greatly appreciated.

Shuguan Liu


1. ELF shared libraries.. help!

Hi all,

I'm developing an application on a number of platforms,  using
ELF shared libraries wherever possible,  and static linking the

There are six shared libraries:   (27k)   (115k)   (33k)   (5k)   (170k)   (300k)

These total to around 655k.

The actual application,  when dynamically linked against these,
is only 140k big.  When statically linked it goes to about 500k.
I can understand that 500k < (655 + 140) because I may not be
linking in certain objects when going static.

The reason I want to use dynamic linking with shared libraries
if because I want to run many of the actual processes without using
lots of memory.  However,  when I run ten of them and do a 'top',
it looks as though all of the shared libraries are being loaded
for all of the processes.  In other words,  each process has a
top line that looks like this:

 24894 marks     1   0  238  760  964 S     0.3  5.0  0:00 myproc

This tell me that each process is using around 1MB of RAM,  which
is much too much!  Am I linking the thing wrong?

What I did is to build the normal static libraries, using -fPIC,
and then using ar rip out the object files and use gcc -shared
to create the .so files.  This works ;-)

Then,  when linking the final executable,  I just did a,
and it found everything just fine.

Am I mistaken?  Will every process that uses a shared library
load a copy of it into memory?  Is this the case fo libc5 etc.?
Is there another way to link the thing so that onlky one copy of
each shared library is loaded?

Perhaps more importantly,  if a new copy of every shared library
will be loaded for every copy of the executable that I run,  surely
it will be faster to use static linking throughout?


2. red hat and apache

3. Help with building shared libraries with dependencies on other shared libraries

4. LANG = C vs En_US

5. Will strip(debug shared library) == nodebug shared library ?

6. Reusing the serial port interrupts

7. Question: Inclusion of shared libraries during linking of shared libraries

8. dfs/dce client, sol x86 (2.5 or 2.6)

9. Shared library loading shared library.

10. Need a Shared Library Guru: beyond simple shared library question

11. When is a shared library not a shared library?

12. Help!! Need help on Shared Libraries

13. Compiling static libraries as shared libraries