diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-02-11 10:28:33 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-02-11 15:20:13 -0800 |
commit | e20365c5d03f0f5eb341e04aafa88f30715e502e (patch) | |
tree | 036550fff88e456fb4bb1d1e6307600e5b7e4590 /ld/lexsup.c | |
parent | 7cae9051edc2e3b11b5c79c08edfb91ee7f4e2e4 (diff) | |
download | gdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.zip gdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.tar.gz gdb-e20365c5d03f0f5eb341e04aafa88f30715e502e.tar.bz2 |
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.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r-- | ld/lexsup.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c index 87341f9..559472f 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1586,15 +1586,14 @@ parse_args (unsigned argc, char **argv) /* We may have -Bsymbolic, -Bsymbolic-functions, --dynamic-list-data, --dynamic-list-cpp-new, --dynamic-list-cpp-typeinfo and --dynamic-list FILE. -Bsymbolic and -Bsymbolic-functions are - for shared libraries. -Bsymbolic overrides all others and vice - versa. */ + for PIC outputs. -Bsymbolic overrides all others and vice versa. */ switch (command_line.symbolic) { case symbolic_unset: break; case symbolic: - /* -Bsymbolic is for shared library only. */ - if (bfd_link_dll (&link_info)) + /* -Bsymbolic is for PIC output only. */ + if (bfd_link_pic (&link_info)) { link_info.symbolic = TRUE; /* Should we free the unused memory? */ @@ -1603,8 +1602,8 @@ parse_args (unsigned argc, char **argv) } break; case symbolic_functions: - /* -Bsymbolic-functions is for shared library only. */ - if (bfd_link_dll (&link_info)) + /* -Bsymbolic-functions is for PIC output only. */ + if (bfd_link_pic (&link_info)) command_line.dynamic_list = dynamic_list_data; break; } |