diff options
author | Ian Lance Taylor <iant@google.com> | 2008-01-15 23:41:28 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2008-01-15 23:41:28 +0000 |
commit | 091244672e9cb571cb7272d491826f85de871ced (patch) | |
tree | 40be47b8e61a974e262595c7aa516f597970f285 /gold/options.cc | |
parent | 58da7b1b61de1ecfbcae3bf0050e8bb65d3ff547 (diff) | |
download | gdb-091244672e9cb571cb7272d491826f85de871ced.zip gdb-091244672e9cb571cb7272d491826f85de871ced.tar.gz gdb-091244672e9cb571cb7272d491826f85de871ced.tar.bz2 |
From Andrew Chatham and Craig Silverstein: Add support for version
scripts.
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gold/options.cc b/gold/options.cc index 9b5103c..9198136 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -155,7 +155,23 @@ invoke_script(int argc, char** argv, char* arg, bool long_option, arg, long_option, &ret); if (!read_commandline_script(script_name, cmdline)) - gold::gold_error(_("unable to parse script file %s"), script_name); + gold::gold_fatal(_("unable to parse script file %s"), script_name); + return ret; +} + +// Handle the special --version-script option, which reads a version script. + +int +invoke_version_script(int argc, char** argv, char* arg, bool long_option, + gold::Command_line* cmdline) +{ + int ret; + const char* script_name = cmdline->get_special_argument("version-script", + argc, argv, + arg, long_option, + &ret); + if (!read_version_script(script_name, cmdline)) + gold::gold_fatal(_("unable to parse version script file %s"), script_name); return ret; } @@ -458,6 +474,9 @@ options::Command_line_options::options[] = SPECIAL('T', "script", N_("Read linker script"), N_("-T FILE, --script FILE"), TWO_DASHES, &invoke_script), + SPECIAL('\0', "version-script", N_("Read version script"), + N_("--version-script FILE"), TWO_DASHES, + &invoke_version_script), GENERAL_NOARG('\0', "threads", N_("Run the linker multi-threaded"), NULL, TWO_DASHES, &General_options::set_threads), GENERAL_NOARG('\0', "no-threads", N_("Do not run the linker multi-threaded"), |