aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-10-31 10:27:34 +0000
committerNick Clifton <nickc@redhat.com>2003-10-31 10:27:34 +0000
commit0013291dce39125792058ff42e1cd8e413ba091f (patch)
treee4a24676242b691956360435850744f937117ce1 /ld
parent83b6e7e8457133ccde176aebc88a4d2f7f8ba12e (diff)
downloadgdb-0013291dce39125792058ff42e1cd8e413ba091f.zip
gdb-0013291dce39125792058ff42e1cd8e413ba091f.tar.gz
gdb-0013291dce39125792058ff42e1cd8e413ba091f.tar.bz2
When looking for a previously loaded file compare the local_sym_name not the
filename, as the filename might have been transformed via the search directory path lookup. If the sought-for file has not been found in the input file chain then create a new node with the search_dirs_flag set so that the entire set of directory paths will be scanned for it.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/ldlang.c13
2 files changed, 19 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b5efd5c..83350bd 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2003-10-31 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lookup_name): When looking for a previously loaded
+ file compare the local_sym_name not the filename, as the
+ filename might have been transformed via the search directory
+ path lookup.
+ If the sought-for file has not been found in the input file
+ chain then create a new node with the search_dirs_flag set so
+ that the entire set of directory paths will be scanned for it.
+
2003-10-30 Andrew Cagney <cagney@redhat.com>
* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
diff --git a/ld/ldlang.c b/ld/ldlang.c
index b343c27..1dc2b1e 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1320,16 +1320,21 @@ lookup_name (const char *name)
search != NULL;
search = (lang_input_statement_type *) search->next_real_file)
{
- if (search->filename == NULL && name == NULL)
+ /* Use the local_sym_name as the name of the file that has
+ already been loaded as filename might have been transformed
+ via the search directory lookup mechanism. */
+ const char * filename = search->local_sym_name;
+
+ if (filename == NULL && name == NULL)
return search;
- if (search->filename != NULL
+ if (filename != NULL
&& name != NULL
- && strcmp (search->filename, name) == 0)
+ && strcmp (filename, name) == 0)
break;
}
if (search == NULL)
- search = new_afile (name, lang_input_file_is_file_enum, default_target,
+ search = new_afile (name, lang_input_file_is_search_file_enum, default_target,
FALSE);
/* If we have already added this file, or this file is not real