PIE and --(no-)export-dynamic

Peter Hjalmarsson xake@rymdraket.net
Sun Mar 21 01:43:00 GMT 2010


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?
(this on a F13-box running ld 2.20.51.0.2, can reproduce on a Gentoo box
running 2.20.1)

Regards
Peter



More information about the Binutils mailing list