dlopen.3: Clarify when an executable's symbols can be used for symbol resolution

The --export-dynamic linker option is not the only way that main's
global symbols may end up in the dynamic symbol table and thus be
used to satisfy symbol reference in a shared object. A symbol
may also be placed into the dynamic symbol table if ld(1)
notices a dependency in another object during the static link.

Verified by experiment; see previous commit.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2019-07-03 10:06:36 +02:00
parent 43898de488
commit 58a4ac49d4
1 changed files with 11 additions and 4 deletions

View File

@ -214,10 +214,17 @@ flag;
and definitions in the shared object itself
(and any dependencies that were loaded for that object).
.PP
If the executable was linked with the flag "\-rdynamic"
(or, synonymously, "\-\-export\-dynamic"),
then global symbols in the executable will also be used
to resolve references in a dynamically loaded shared object.
Any global symbols in the executable that were placed into
its dynamic symbol table by
.BR ld (1)
can also be used to resolve references in a dynamically loaded shared object.
Symbols may be placed in the dynamic symbol table
either because the executable was linked with the flag "\-rdynamic"
(or, synonymously, "\-\-export\-dynamic"), which causes all of
the executable's global symbols to be placed in the dynamic symbol table,
or because
.BR ld (1)
noted a dependency on a symbol in another object during static linking.
.PP
If the same shared object is opened again with
.BR dlopen (),