This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PIE and --(no-)export-dynamic
- From: Alan Modra <amodra at gmail dot com>
- To: Peter Hjalmarsson <xake at rymdraket dot net>
- Cc: binutils <binutils at sourceware dot org>
- Date: Sun, 21 Mar 2010 12:11:45 +1030
- Subject: Re: PIE and --(no-)export-dynamic
- References: <1269091979.15822.25.camel@lillen>
On Sat, Mar 20, 2010 at 02:32:59PM +0100, Peter Hjalmarsson wrote:
> Should the -export-dynamic/--no-export-dynamic do any difference on a
> PIE file?
>
> As an example lets take ld/testsuite/ld-elfvers/vers4.c.
> compile it:
>
> $ gcc -o test1 -Wl,--no-export-dynamic vers4.c
> $ gcc -o test2 -fPIE -pie -Wl,--no-export-dynamic vers4.c
>
> If you objdump -T the resulting files you will see that test2 still
> exports foo@@VERS_2.0 along other things (like main).
>
> Is this a expected behaviour or is it a bug?
I think you are reading too much into the name of the option.
--no-export-dynamic doesn't say "don't export any dynamic symbols".
It is merely there to turn off --export-dynamic. See the ld info
doc.
--
Alan Modra
Australia Development Lab, IBM