aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-01-08 14:56:09 +0000
committerAlexandre Oliva <aoliva@redhat.com>2002-01-08 14:56:09 +0000
commit34efb44947f434bef3f19231aa2d2d917ec2f4f1 (patch)
tree5fa51faef1ccd8d5610f6a6bc431d32724121984 /ld/ldlang.c
parentc25b74acfa368b092f3a225ad801b11c73d2b4b3 (diff)
downloadgdb-34efb44947f434bef3f19231aa2d2d917ec2f4f1.zip
gdb-34efb44947f434bef3f19231aa2d2d917ec2f4f1.tar.gz
gdb-34efb44947f434bef3f19231aa2d2d917ec2f4f1.tar.bz2
* ldlang.c (walk_wild_section): Exclude object file if enclosing
archive is excluded.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index afce0fa..a7b53dd 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1,6 +1,6 @@
/* Linker command language support.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001
+ 2001, 2002
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -270,6 +270,21 @@ walk_wild_section (ptr, file, callback, data)
else
skip = strcmp (list_tmp->name, file->filename) == 0;
+ /* If this file is part of an archive, and the archive is
+ excluded, exclude this file. */
+ if (! skip && file->the_bfd != NULL
+ && file->the_bfd->my_archive != NULL
+ && file->the_bfd->my_archive->filename != NULL)
+ {
+ if (wildcardp (list_tmp->name))
+ skip = fnmatch (list_tmp->name,
+ file->the_bfd->my_archive->filename,
+ 0) == 0;
+ else
+ skip = strcmp (list_tmp->name,
+ file->the_bfd->my_archive->filename) == 0;
+ }
+
if (skip)
break;
}