* ldlang.c (walk_wild_section): Exclude object file if enclosing
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 8 Jan 2002 14:56:09 +0000 (14:56 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Tue, 8 Jan 2002 14:56:09 +0000 (14:56 +0000)
archive is excluded.

ld/ChangeLog
ld/ldlang.c

index 720e83ba1d3a5a5e569a558046d1f25dd452a29a..0202545f232603c22de735908289cdb1743d9ada 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-08  Alexandre Oliva  <aoliva@redhat.com>
+
+       * ldlang.c (walk_wild_section): Exclude object file if enclosing
+       archive is excluded.
+
 2002-01-07  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o.
index afce0fa5c23f9c354c3c8451ce7da1c7c9ae1456..a7b53dd1b0f6a0c57eaa2f216ab08e48d59f558c 100644 (file)
@@ -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;
            }