diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2007-01-19 15:13:29 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2007-01-19 15:13:29 +0000 |
commit | d8cf8b513333c644cc5305eff9d5c0dfcac69de5 (patch) | |
tree | 56edbe9735dd0cdbcd4825f6d4321552670f4b63 /ld/ldmain.c | |
parent | b81428656759ee87a5619f8495c04123ec71d582 (diff) | |
download | gdb-d8cf8b513333c644cc5305eff9d5c0dfcac69de5.zip gdb-d8cf8b513333c644cc5305eff9d5c0dfcac69de5.tar.gz gdb-d8cf8b513333c644cc5305eff9d5c0dfcac69de5.tar.bz2 |
ld/
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld.h (args_type): Add new symbolic and dynamic_list fields.
* ld.texinfo: Update -Bsymbolic-functions.
* ldmain.c (main): Initialize command_line.symbolic to
symbolic_unset and command_line.dynamic_list to
dynamic_list_unset. Check -Bsymbolic, -Bsymbolic-functions and
--dynamic-list* before setting link_info.symbolic,
link_info.dynamic and link_info.dynamic_data.
* lexsup.c (option_values): Add OPTION_SYMBOLIC_FUNCTIONS.
(ld_options): Use OPTION_SYMBOLIC_FUNCTIONS with
-Bsymbolic-functions.
(parse_args): Handle -Bsymbolic-functions. Don't set
link_info.dynamic, link_info.dynamic_data and link_info.symbolic
here. Set command_line.symbolic for -Bsymbolic. Set
command_line.dynamic_list and command_line.symbolic for
--dynamic-list-data, --dynamic-list-cpp-new,
--dynamic-list-cpp-typeinfo and --dynamic-list.
ld/testsuite/
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/dl6.c: New file.
* ld-elf/dl6a.out: Likewise.
* ld-elf/dl6amain.c: Likewise.
* ld-elf/dl6b.out: Likewise.
* ld-elf/dl6bmain.c: Likewise.
* ld-elf/dl6cmain.c: Likewise.
* ld-elf/dl6dmain.c: Likewise.
* ld-elf/shared.exp: Add new tests for -Bsymbolic,
-Bsymbolic-functions, --dynamic-list-data and
--dynamic-list-cpp-new.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index 8bd4bf4..9e6a0c3 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -256,6 +256,8 @@ main (int argc, char **argv) command_line.warn_mismatch = TRUE; command_line.check_section_addresses = TRUE; command_line.accept_unknown_input_arch = FALSE; + command_line.symbolic = symbolic_unset; + command_line.dynamic_list = dynamic_list_unset; sort_section = none; @@ -356,6 +358,43 @@ main (int argc, char **argv) einfo (_("%P%F: -r and -shared may not be used together\n")); } + /* 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. */ + switch (command_line.symbolic) + { + case symbolic_unset: + break; + case symbolic: + /* -Bsymbolic is for shared library only. */ + if (link_info.shared) + { + link_info.symbolic = TRUE; + /* Should we free the unused memory? */ + link_info.dynamic_list = NULL; + command_line.dynamic_list = dynamic_list_unset; + } + break; + case symbolic_functions: + /* -Bsymbolic-functions is for shared library only. */ + if (link_info.shared) + command_line.dynamic_list = dynamic_list_data; + break; + } + + switch (command_line.dynamic_list) + { + case dynamic_list_unset: + break; + case dynamic_list_data: + link_info.dynamic_data = TRUE; + case dynamic_list: + link_info.dynamic = TRUE; + break; + } + if (! link_info.shared) { if (command_line.filter_shlib) |