dynamic loading: linker bug w.r.t. --export-dynamic ?

dynamic loading: linker bug w.r.t. --export-dynamic ?

Post by Oleg » Wed, 26 Mar 2003 05:52:23


I have file1.c that defines function fn. I also have file2.c that _declares_
function fn (with the same signature).

I use file1.c to make an exectuable file1 :

gcc -rdynamic -c file1.c
gcc -rdynamic --export-dynamic -o file1 file1.o -ldl )

And I use file2.c to make a shared library ./libfile2.so :

gcc -rdynamic -c file2.c
gcc -shared -rdynamic --export-dynamic -o libfile2.so file2.o

file1 dynamically loads libfile2.so at run-time. This loading fails at
run-time if and only if file2 _uses_ the aforementioned function fn :

./libfile2.so: undefined symbol: fn

I'm a very puzzled by this, since ld manual says, in part:

    When  creating a dynamically linked executable, add all symbols
    to the dynamic symbol table.  The dynamic symbol table is the
    set of symbols which are visible from dynamic objects at run time."

Is this option being ignored? (I use some compiler and linker options
redundantly just in case)

My system is Debian 3.0; dl library is part of libc6 2.2.5;
I got the same results with GCC 3.2.2 and GCC 2.95.4

Thank you


dynamic loading: linker bug w.r.t. --export-dynamic ?

Post by Oleg » Wed, 26 Mar 2003 06:55:23


Ignore please. Problem solved.



1. BUG IN DYNAMIC LINKER .."bad dynamic tag".


while compilling Mysql-3.22.32 and PHP4.0.2 under Linux 2.2.16,
libc-2.1.3-163,libelf-0.7.0-131, glib-1.2.8-57, glibdev-1.2.8-57 I'm
getting following error:
make[2]: Entering directory
rm -f libreadline.a
ar cru libreadline.a readline.o funmap.o keymaps.o vi_mode.o parens.o
rltty.o complete.o bind.o isearch.o display.o signals.o util.o kill.o
undo.o macro.o input.o callback.o terminal.o xmalloc.o history.o
histsearch.o histexpand.o histfile.o nls.o search.o shell.o tilde.o
BUG IN DYNAMIC LINKER ld.so: dynamic-link.h: 57: elf_get_dynamic_info:
Assertion `! "bad dynamic tag"' failed!
make[2]: *** [libreadline.a] Error 127

Can you point me to the right direction?
Thanks for any help

2. IP Masquerade with Novell's IP Tunnel

3. dynamic loading vs. dynamic linking

4. Yellow dog video failure on iBook 2 help?

5. Can't load dynamic linker '/lib/ld.so'

6. (no subject)

7. can't load dynamic linker '/lib/ld.so'

8. X window freeze

9. Linux loading error - dynamic linker?

10. Flakey startup problem: bug in dynamic linker

11. Bug in dynamic linker

12. BUG in Dynamic Linker