PIE and --(no-)export-dynamic
Alan Modra
amodra@gmail.com
Sun Mar 21 02:35:00 GMT 2010
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
More information about the Binutils
mailing list