aboutsummaryrefslogtreecommitdiff
path: root/ld/lexsup.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2005-01-19 11:42:49 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2005-01-19 11:42:49 +0000
commite22430578c7bc54a36eb0a8cc0a083f5b4826998 (patch)
tree23f1a24cbe20dc77284ec48185ef5e5a6022b72e /ld/lexsup.c
parent53283f867b4157d728963a9699bce30e2d24f033 (diff)
downloadgdb-e22430578c7bc54a36eb0a8cc0a083f5b4826998.zip
gdb-e22430578c7bc54a36eb0a8cc0a083f5b4826998.tar.gz
gdb-e22430578c7bc54a36eb0a8cc0a083f5b4826998.tar.bz2
* ldmain.h (ld_sysroot): Change type to a constant string.
* ldmain.c (ld_sysroot): Likewise. (get_relative_sysroot, get_sysroot): New functions, adding command-line support for changing the sysroot. (main): Call the new functions. * lexsup.c (OPTION_SYSROOT): New. (ld_options): Add --sysroot. (parse_args): Add a dummy handler for it. * ld.texinfo (--sysroot): Document. * NEWS: Mention the new --sysroot option.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r--ld/lexsup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index d85d912..21eb1dc 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -71,6 +71,7 @@ enum option_values
OPTION_DEFSYM,
OPTION_DEMANGLE,
OPTION_DYNAMIC_LINKER,
+ OPTION_SYSROOT,
OPTION_EB,
OPTION_EL,
OPTION_EMBEDDED_RELOCS,
@@ -233,6 +234,8 @@ static const struct ld_option ld_options[] =
{ {"library-path", required_argument, NULL, 'L'},
'L', N_("DIRECTORY"), N_("Add DIRECTORY to library search path"),
TWO_DASHES },
+ { {"sysroot=<DIRECTORY>", required_argument, NULL, OPTION_SYSROOT},
+ '\0', NULL, N_("Override the default sysroot location"), TWO_DASHES },
{ {NULL, required_argument, NULL, '\0'},
'm', N_("EMULATION"), N_("Set emulation"), ONE_DASH },
{ {"print-map", no_argument, NULL, 'M'},
@@ -747,6 +750,9 @@ parse_args (unsigned argc, char **argv)
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;
break;
+ case OPTION_SYSROOT:
+ /* Already handled in ldmain.c. */
+ break;
case OPTION_EB:
command_line.endian = ENDIAN_BIG;
break;