X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bfd%2Felf32-msp430.c;h=fe5fd8ff8c109467be5e8b385a89089a4f2faa3b;hb=c0d9f31dbd8765dd925e6a4b4acdb9b23d1706f6;hp=2d351d3906cc5f985d43d9b6766ae2b2ab100b90;hpb=f3185997ac0951edac802e29df03dfc0844fda34;p=external%2Fbinutils.git diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 2d351d3..fe5fd8f 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -1,5 +1,5 @@ /* MSP430-specific support for 32-bit ELF - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. @@ -1385,9 +1385,8 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, file. This gets the MSP430 architecture right based on the machine number. */ -static void -bfd_elf_msp430_final_write_processing (bfd * abfd, - bfd_boolean linker ATTRIBUTE_UNUSED) +static bfd_boolean +bfd_elf_msp430_final_write_processing (bfd *abfd) { unsigned long val; @@ -1422,6 +1421,7 @@ bfd_elf_msp430_final_write_processing (bfd * abfd, elf_elfheader (abfd)->e_machine = EM_MSP430; elf_elfheader (abfd)->e_flags &= ~EF_MSP430_MACH; elf_elfheader (abfd)->e_flags |= val; + return _bfd_elf_final_write_processing (abfd); } /* Set the right machine number. */ @@ -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) {