summaryrefslogtreecommitdiff
path: root/ld/ldfile.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2009-04-14 02:47:22 +0000
committerH.J. Lu <hjl@lucon.org>2009-04-14 02:47:22 +0000
commit3a9aff9be9c23cfc8b66abe1bd0dfd5ba5545f75 (patch)
treee0281e0944f09af0df28729ef98b7e55adea1755 /ld/ldfile.c
parent7dd6e742539bbc05c6b2e3ad679ae9114db4cfb4 (diff)
downloadbinutils-redhat-3a9aff9be9c23cfc8b66abe1bd0dfd5ba5545f75.tar.gz
2009-04-13 H.J. Lu <hongjiu.lu@intel.com>
* ldfile.c (ldfile_find_command_file): Revert the last change.
Diffstat (limited to 'ld/ldfile.c')
-rw-r--r--ld/ldfile.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/ld/ldfile.c b/ld/ldfile.c
index 2aff713964..422416a8b4 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -542,10 +542,10 @@ find_scripts_dir (void)
return NULL;
}
-/* Try to open NAME; if that fails, look for it in directories specified
- with -L, then in the default script directory, without and with EXTEND
- appended. If DEFAULT_ONLY is true, the search is restricted to the
- default script location. */
+/* If DEFAULT_ONLY is false, try to open NAME; if that fails, look for
+ it in directories specified with -L, then in the default script
+ directory, without and with EXTEND appended. If DEFAULT_ONLY is
+ true, the search is restricted to the default script location. */
static FILE *
ldfile_find_command_file (const char *name, const char *extend,
@@ -556,10 +556,13 @@ ldfile_find_command_file (const char *name, const char *extend,
char *buffer;
static search_dirs_type *script_search;
- /* First try raw name for uninstalled linker. */
- result = try_open (name, "");
- if (result != NULL)
- return result;
+ if (!default_only)
+ {
+ /* First try raw name. */
+ result = try_open (name, "");
+ if (result != NULL)
+ return result;
+ }
if (!script_search)
{