aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/ldmain.c3
-rw-r--r--ld/ldmisc.c9
-rw-r--r--ld/plugin.c9
4 files changed, 23 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e5614ba..ac56c8f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2016-06-14 Alan Modra <amodra@gmail.com>
+
+ PR ld/20241
+ * ldmain.c (add_archive_element): Just print file name of file within
+ thin archives.
+ * ldmisc.c (vfinfo): Likewise.
+ * plugin.c (plugin_object_p): Open file within thin archives.
+ (plugin_maybe_claim): Expand comment.
+
2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
PR ld/20244
diff --git a/ld/ldmain.c b/ld/ldmain.c
index f16e33b..3c5065f 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -865,7 +865,8 @@ add_archive_element (struct bfd_link_info *info,
header_printed = TRUE;
}
- if (bfd_my_archive (abfd) == NULL)
+ if (bfd_my_archive (abfd) == NULL
+ || bfd_is_thin_archive (bfd_my_archive (abfd)))
{
minfo ("%s", bfd_get_filename (abfd));
len = strlen (bfd_get_filename (abfd));
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 70e12ea..321db9a 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -201,7 +201,8 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
if (abfd == NULL)
fprintf (fp, "%s generated", program_name);
- else if (abfd->my_archive)
+ else if (abfd->my_archive != NULL
+ && !bfd_is_thin_archive (abfd->my_archive))
fprintf (fp, "%s(%s)", abfd->my_archive->filename,
abfd->filename);
else
@@ -230,11 +231,13 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
lang_input_statement_type *i;
i = va_arg (arg, lang_input_statement_type *);
- if (bfd_my_archive (i->the_bfd) != NULL)
+ if (bfd_my_archive (i->the_bfd) != NULL
+ && !bfd_is_thin_archive (bfd_my_archive (i->the_bfd)))
fprintf (fp, "(%s)",
bfd_get_filename (bfd_my_archive (i->the_bfd)));
fprintf (fp, "%s", i->local_sym_name);
- if (bfd_my_archive (i->the_bfd) == NULL
+ if ((bfd_my_archive (i->the_bfd) == NULL
+ || bfd_is_thin_archive (bfd_my_archive (i->the_bfd)))
&& filename_cmp (i->local_sym_name, i->filename) != 0)
fprintf (fp, " (%s)", i->filename);
}
diff --git a/ld/plugin.c b/ld/plugin.c
index c951995..c347cfa 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -1089,7 +1089,8 @@ plugin_object_p (bfd *ibfd)
return NULL;
}
- inarchive = bfd_my_archive (ibfd) != NULL;
+ inarchive = (bfd_my_archive (ibfd) != NULL
+ && !bfd_is_thin_archive (bfd_my_archive (ibfd)));
name = inarchive ? bfd_my_archive (ibfd)->filename : ibfd->filename;
fd = open (name, O_RDONLY | O_BINARY);
@@ -1201,8 +1202,10 @@ plugin_maybe_claim (lang_input_statement_type *entry)
/* Discard the real file's BFD and substitute the dummy one. */
- /* BFD archive handling caches elements so we can't call
- bfd_close for archives. */
+ /* We can't call bfd_close on archives. BFD archive handling
+ caches elements, and add_archive_element keeps pointers to
+ the_bfd and the_bfd->filename in a lang_input_statement_type
+ linker script statement. */
if (entry->the_bfd->my_archive == NULL)
bfd_close (entry->the_bfd);
entry->the_bfd = abfd;