Subject: bin/9495: gcc ignores -rdynamic
To: None <>
From: None <>
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

>Release:        1.4.1 <NetBSD-current source date>
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

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.


I have an example at

on an ELF machine:

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

./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

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