Shared objects



Hello,

I don't understand the purpose of dlopen() and friends.

$ cat mini.c
int main(void) { return 0; }
$ gcc -O2 mini.c
$ ldd a.out
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7df7000)
/lib/ld-linux.so.2 (0xb7f41000)

If all my executables use libc.so instead of libc.a, I will get all
the benefits of dynamic linking.

Where would I use dlopen() instead of just providing the name of
the library when I build my executable?

In short, when / where do people use dlopen?
.



Relevant Pages

  • Re: Shared objects
    ... int main ... $ gcc -O2 mini.c ... $ ldd a.out ... If all my executables use libc.so instead of libc.a, ...
    (comp.unix.programmer)
  • Re: C++ programming migration from DOS to Windows
    ... The good news is that as has been claimed, gcc clearly _is_ better than ... showed VC++ 7.1 winning by about a 61% margin overall. ... the MinGW executable was approximately 2.7 times as large. ... The executables were both built for Win32 using SSE instructions. ...
    (comp.lang.cpp)
  • Re: [announce] [patch] NX (No eXecute) support for x86, 2.6.7-rc2-bk2
    ... It's only that good because gcc handles it transparently. ... it has a trampoline. ... Old executables are run with NX off. ... Of course that is only for the stack. ...
    (Linux-Kernel)
  • Re: When will 2007 standard be available in gcc-ada?
    ... 1/ If you get a GCC compiler executable from any 3rd party then this ... If the GCC executables are spread across linkable object files, ... application across exe, dll, whatever, or if you link pre-built ... the non-free main program would violate the GPL." ...
    (comp.lang.ada)
  • Re: 1)Executing by reading from executable 2)Compileing in a program
    ... typedef int; ... Now I use the compiler that is included within the program. ... The mini-OS itself appears to the host OS as a single running ... The executables it runs are in native compiled code, ...
    (comp.lang.c)