I have 2 application lets say A1 ,A2 shared one shared object(lets say lib1) which loaded in application at runtime. A1 load lib1 using dlopen successfully. Now A2 wants to load library. Can A2?(as lib1 loaded in A1 address space). What if A1 load using RTLD_LOCAL. Can A2 load lib?

  • 2
    Shared libraries wouldn't be very useful if that didn't work. You'd only ever be able to start one non-static process on your computer, all others would fail because they can't load libc.
    – Mat
    May 9, 2012 at 5:35

1 Answer 1


Yes, of course. From the Wikipedia article on libraries:

A shared library or shared object is a file that is intended to be shared by executable files and further shared objects files

In other words, the whole reason they're called "shared" is because more than one executable is using them.

From the docs for RTLD_LOCAL:

Symbols defined in this library are not made available to resolve references in subsequently loaded libraries.

The RTLD_LOCAL flag to dlopen() simply indicates that when A1 loads lib1, if it defines, say, a function f1(), and then A1 loads lib2, it can't use the f1() from lib1, because that was loaded local.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.