From e20365c5d03f0f5eb341e04aafa88f30715e502e Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 11 Feb 2016 10:28:33 -0800 Subject: Enable -Bsymbolic and -Bsymbolic-functions to PIE Before binutils 2.26, -Bsymbolic and -Bsymbolic-functions were also applied to PIE so that "ld -pie -Bsymbolic -E" can be used to export symbols in PIE with local binding. This patch re-enables -Bsymbolic and -Bsymbolic-functions for PIE. PR ld/19615 * ld.texinfo: Document -Bsymbolic and -Bsymbolic-functions for PIE. * lexsup.c (parse_args): Enable -Bsymbolic and -Bsymbolic-functions for PIE. * testsuite/ld-i386/i386.exp: Run pr19175. * testsuite/ld-i386/pr19615.d: New file. * testsuite/ld-i386/pr19615.s: Likewise. * testsuite/ld-x86-64/pr19615.d: Likewise. * testsuite/ld-x86-64/pr19615.s: Likewise. --- ld/ld.texinfo | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ld/ld.texinfo') diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 8507c3f..723e5e8 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -1325,15 +1325,21 @@ libraries. When creating a shared library, bind references to global symbols to the definition within the shared library, if any. Normally, it is possible for a program linked against a shared library to override the definition -within the shared library. This option is only meaningful on ELF -platforms which support shared libraries. +within the shared library. This option can also be used with the +@option{--export-dynamic} option, when creating a position independent +executable, to bind references to global symbols to the definition within +the executable. This option is only meaningful on ELF platforms which +support shared libraries and position independent executables. @kindex -Bsymbolic-functions @item -Bsymbolic-functions When creating a shared library, bind references to global function symbols to the definition within the shared library, if any. +This option can also be used with the @option{--export-dynamic} option, +when creating a position independent executable, to bind references +to global function symbols to the definition within the executable. This option is only meaningful on ELF platforms which support shared -libraries. +libraries and position independent executables. @kindex --dynamic-list=@var{dynamic-list-file} @item --dynamic-list=@var{dynamic-list-file} -- cgit v1.1