diff options
Diffstat (limited to 'bfd/format.c')
-rw-r--r-- | bfd/format.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/bfd/format.c b/bfd/format.c index d2bc318..fba8d2a 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -47,7 +47,6 @@ SUBSECTION #include "bfd.h" #include "libbfd.h" #if BFD_SUPPORTS_PLUGINS -#include "plugin-api.h" #include "plugin.h" #endif @@ -389,6 +388,11 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) abfd->object_only_section = sec; break; } + else if (strcmp (sec->name, ".llvm.lto") == 0) + { + type = lto_fat_ir_object; + break; + } else if (lsection.major_version == 0 && startswith (sec->name, ".gnu.lto_.lto.") && bfd_get_section_contents (abfd, sec, &lsection, 0, @@ -453,10 +457,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) } if (abfd->format != bfd_unknown) - { - bfd_set_lto_type (abfd); - return abfd->format == format; - } + return abfd->format == format; if (matching != NULL || *bfd_associated_vector != NULL) { @@ -510,7 +511,20 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) cleanup = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (cleanup) + /* When called from strip, don't treat archive member nor + standalone fat IR object as an IR object. For archive + member, it will be copied as an unknown object if the + plugin target is in use or it is a slim IR object. For + standalone fat IR object, it will be copied as non-IR + object. */ + if (cleanup +#if BFD_SUPPORTS_PLUGINS + && (!abfd->is_strip_input + || !bfd_plugin_target_p (abfd->xvec) + || (abfd->lto_type != lto_fat_ir_object + && abfd->my_archive == NULL)) +#endif + ) goto ok_ret; /* For a long time the code has dropped through to check all |