Bug 444628 - ld: --export-dynamic fails if no undefined symbols
ld: --export-dynamic fails if no undefined symbols
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-29 12:20 EDT by John Reiser
Modified: 2008-04-29 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-29 12:49:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Reiser 2008-04-29 12:20:26 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
modules.

Version-Release number of selected component (if applicable):
binutils-2.18.50.0.6-2.i386


How reproducible: always


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:


Additional info:
Comment 1 Jakub Jelinek 2008-04-29 12:49:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.