diff options
author | Nick Clifton <nickc@redhat.com> | 2003-03-25 10:29:28 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-03-25 10:29:28 +0000 |
commit | 3fe38064baf3b9afbd892b0df390b3879d9072a9 (patch) | |
tree | 60f7686e039dcb88d3dfecf769ad44fa33dfbb77 /ld/ldmain.c | |
parent | 2cf6873caef1b656aeacdea811c225bdd53e9029 (diff) | |
download | gdb-3fe38064baf3b9afbd892b0df390b3879d9072a9.zip gdb-3fe38064baf3b9afbd892b0df390b3879d9072a9.tar.gz gdb-3fe38064baf3b9afbd892b0df390b3879d9072a9.tar.bz2 |
ldmain.c (ld_canon_sysroot, ld_canon_sysroot_len): Define. (main): Initialize them.
ldfile.c: Include pathnames.h. (is_sysrooted_pathname): New. (ldfile_add_library_path): Use it.
(ldfile_open_file_search): Likewise. Use IS_ABSOLUTE_PATH.
Don't search_dirs if given an absolute pathname.
(ldfile_open_file): Issue error message for sysrooted absolute pathnames.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r-- | ld/ldmain.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c index 214847d..284b975 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -72,6 +72,10 @@ char *program_name; /* The prefix for system library directories. */ char *ld_sysroot; +/* The canonical representation of ld_sysroot. */ +char * ld_canon_sysroot; +int ld_canon_sysroot_len; + /* The file that we're creating. */ bfd *output_bfd = 0; @@ -234,6 +238,14 @@ main (argc, argv) #endif ld_sysroot = TARGET_SYSTEM_ROOT; + if (ld_sysroot && *ld_sysroot) + ld_canon_sysroot = lrealpath (ld_sysroot); + + if (ld_canon_sysroot) + ld_canon_sysroot_len = strlen (ld_canon_sysroot); + else + ld_canon_sysroot_len = -1; + /* Set the default BFD target based on the configured target. Doing this permits the linker to be configured for a particular target, and linked against a shared BFD library which was configured for |