Red Hat Bugzilla – Bug 444628
ld: --export-dynamic fails if no undefined symbols
Last modified: 2008-04-29 12:49:48 EDT
Description of problem: If there are no undefined symbols then there is no
Dynamic section, no DT_SYMTAB, and no DT_HASH/DT_GNU_HASH; and --export-dynamic
fails silently. So there is no way to have a module (ET_EXEC or ET_DYN) that
has no undefined symbols, yet exports some of its own symbols for use by other
Version-Release number of selected component (if applicable):
How reproducible: always
Steps to Reproduce:
1. cat <<EOF >export.S
_start: .globl _start
foo: .globl foo
2. gcc -o export -nostartfiles -nostdlib -Wl,--export-dynamic export.S
3. readelf --all export | grep -i dynamic
There is no dynamic section in this file.
Dynamic section at offset 0x.... contains .. entries:
I don't see what that would be useful for, dlopen in statically linked programs
is something we certainly don't want to encourage.
If you want to make this supported, try filing it in upstream bugzilla.