diff options
author | Alan Modra <amodra@gmail.com> | 2016-06-14 13:12:00 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-06-14 13:12:00 +0930 |
commit | b0cffb47671ffbaac559c1f17a9f248256ea6c42 (patch) | |
tree | 8a671e9057ebcd1cc30e15f0caedc9b6bcad32ac /ld/ldmisc.c | |
parent | 57bc0e78e9d1fc318e1265f22280e1c3b7527d65 (diff) | |
download | gdb-b0cffb47671ffbaac559c1f17a9f248256ea6c42.zip gdb-b0cffb47671ffbaac559c1f17a9f248256ea6c42.tar.gz gdb-b0cffb47671ffbaac559c1f17a9f248256ea6c42.tar.bz2 |
Set my_archive for thin archives
LTO plugin support in plugin_maybe_claim wants to close the IR bfd
after replacing it with the recompiled object, but can't do so for
archive elements due to various pointers that access the archive bfd.
Thin archives have the same problem. They too cannot have their
element bfds closed.
PR ld/20241
bfd/
* archive.c (open_nested_file): Set my_archive.
* bfd.c (_bfd_default_error_handler <%B>): Exclude archive file name
for thin archives.
* bfdio.c (bfd_tell): Don't adjust origin for thin archives.
(bfd_seek): Likewise.
* bfdwin.c (bfd_get_file_window): Likewise.
* cache.c (cache_bmmap): Likewise.
(bfd_cache_lookup_worker): Don't look in my_archive for thin archives.
* mach-o.c (bfd_mach_o_follow_dsym): Don't open my_archive for
thin archives.
* plugin.c (try_claim): Likewise.
* xcofflink.c (xcoff_link_add_dynamic_symbols): Use import path of
file within thin archive, not the archive.
binutils/
* bucomm.c (bfd_get_archive_filename): Return file name within thin
archive.
ld/
* 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.
Diffstat (limited to 'ld/ldmisc.c')
-rw-r--r-- | ld/ldmisc.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); } |