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 modules.
Steps to Reproduce: 1. cat <<EOF >export.S _start: .globl _start movl foo,%ebx movl $1,%eax int $0x80 .data foo: .globl foo .int 42 EOF 2. gcc -o export -nostartfiles -nostdlib -Wl,--export-dynamic export.S 3. readelf --all export | grep -i dynamic Actual results: There is no dynamic section in this file. Expected results: Dynamic section at offset 0x.... contains .. entries: [This bug was originally reported in http://bugzilla.redhat.com/show_bug.cgi?id=444628 and is fowarded here at the suggestion of a maintainer.] -- Summary: ld: --export-dynamic fails if no undefined symbols Product: binutils Version: 2.18 Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: jreiser at BitWagon dot com CC: bug-binutils at gnu dot org GCC target triplet: i686-pc-linux-gnu http://sourceware.org/bugzilla/show_bug.cgi?id=6468 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils