Fix linking MSP430 files created by gcc's LTO optimizer.
[deliverable/binutils-gdb.git] / bfd / elf32-msp430.c
index 2d351d3906cc5f985d43d9b6766ae2b2ab100b90..95dae2ef2fff04fa2cc2806376d585dadc391834 100644 (file)
@@ -2424,6 +2424,12 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info)
   if (ibfd->flags & BFD_LINKER_CREATED)
     return TRUE;
 
+  /* LTO can create temporary files for linking which may not have an attribute
+     section.  */
+  if (ibfd->lto_output
+      && bfd_get_section_by_name (ibfd, ".MSP430.attributes") == NULL)
+    return TRUE;
+
   /* If this is the first real object just copy the attributes.  */
   if (!elf_known_obj_attributes_proc (obfd)[0].i)
     {
This page took 0.0238 seconds and 4 git commands to generate.