Subject: bin/9495: gcc ignores -rdynamic
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mcmahill@mtl.mit.edu>
List: netbsd-bugs
Date: 02/26/2000 19:30:41
>Number:         9495
>Category:       bin
>Synopsis:       gcc ignores -rdynamic
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 26 19:30:01 2000
>Last-Modified:
>Originator:     
>Organization:

>Release:        1.4.1 <NetBSD-current source date>
>Environment:
	
System: NetBSD sy-borg 1.4.1 NetBSD 1.4.1 (SY-BORG) #1: Sun Oct 3 00:23:28 EDT 1999 dan@sy-borg:/amd/dinah-moe/export/src/sys/arch/pmax/compile/SY-BORG pmax


>Description:
gcc ignores -rdynamic.  

to make functions in a program available to functions in a shared library on an ELF platform,
it seems like other systems (linux) use the "-rdynamic" flag to gcc.  Under NetBSD-1.4.1, this
flag is ignored and we have to use "-Wl,--export-dynamic" instead.

	
>How-To-Repeat:

I have an example at http://www-mtl.mit.edu/~mcmahill/netbsd/dlexample.tar.gz

on an ELF machine:

mkdir tmp ; cd tmp
tar -zxvf dlexample.tar.gz
make

./tst1   <-- to show the program crash with no -rdynamic or -Wl,--export-dynamic
./tst2   <-- to show the program work correctly with -Wl,--export-dynamic
./tst3   <-- to show the program crash with -rdynamic

	
>Fix:
make -rdynamic do the right thing.  sorry, I don't know how to make this happen....

	
>Audit-Trail:
>Unformatted: