From 3fe38064baf3b9afbd892b0df390b3879d9072a9 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 25 Mar 2003 10:29:28 +0000 Subject: 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. --- ld/ldmain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ld/ldmain.c') 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 -- cgit v1.1