+ /* Find this name in the archive. */
+ bfd *member = obfd->archive_head;
+ bfd **prev = &(obfd->archive_head);
+ int found = 0;
+
+ while (member)
+ {
+ if (FILENAME_CMP (member->filename, list->name) == 0)
+ {
+ /* Found the one to replace. */
+ bfd *abfd = bfd_openr (list->name, NULL);
+
+ if (!abfd)
+ {
+ fprintf (stderr, _("%s: can't open file %s\n"),
+ program_name, list->name);
+ maybequit ();
+ }
+ else
+ {
+ *prev = abfd;
+ abfd->archive_next = member->archive_next;
+ found = 1;
+ }
+ }
+ else
+ {
+ prev = &(member->archive_next);
+ }
+ member = member->archive_next;
+ }
+
+ if (!found)
+ {
+ bfd *abfd = bfd_openr (list->name, NULL);
+
+ fprintf (stderr,_("%s: can't find module file %s\n"),
+ program_name, list->name);
+ if (!abfd)
+ {
+ fprintf (stderr, _("%s: can't open file %s\n"),
+ program_name, list->name);
+ maybequit ();
+ }
+ else
+ *prev = abfd;
+ }