aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-03-04 19:12:43 +0000
committerIan Lance Taylor <ian@airs.com>1996-03-04 19:12:43 +0000
commit3d0c8fa1d4625ec58db6d67f292cfd16af9bfd7e (patch)
treeb1aece2d917ff83f3f9462490e044bbd8d02ebff /ld/ldlang.c
parentcb84f0284f77531a312e788742d06928d880820b (diff)
downloadgdb-3d0c8fa1d4625ec58db6d67f292cfd16af9bfd7e.zip
gdb-3d0c8fa1d4625ec58db6d67f292cfd16af9bfd7e.tar.gz
gdb-3d0c8fa1d4625ec58db6d67f292cfd16af9bfd7e.tar.bz2
* ldlang.c (wild): Handle foo.a(.text) by mapping each included
member of foo.a separately. From Jouke Numan <jnuman@bazis.nl>.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 2c67d27..dc3eaee 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -881,7 +881,34 @@ wild (s, section, file, target, output)
else
{
/* Perform the iteration over a single file */
- wild_section (s, section, lookup_name (file), output);
+ f = lookup_name (file);
+ if (f->the_bfd == NULL
+ || ! bfd_check_format (f->the_bfd, bfd_archive))
+ wild_section (s, section, f, output);
+ else
+ {
+ bfd *member;
+
+ /* This is an archive file. We must map each member of the
+ archive separately. */
+ member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL);
+ while (member != NULL)
+ {
+ /* When lookup_name is called, it will call the
+ add_symbols entry point for the archive. For each
+ element of the archive which is included, BFD will
+ call ldlang_add_file, which will set the usrdata
+ field of the member to the lang_input_statement. */
+ if (member->usrdata != NULL)
+ {
+ wild_section (s, section,
+ (lang_input_statement_type *) member->usrdata,
+ output);
+ }
+
+ member = bfd_openr_next_archived_file (f->the_bfd, member);
+ }
+ }
}
if (section != (char *) NULL
&& strcmp (section, "COMMON") == 0