This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: objcopy: Support merging of notes without SHF_GNU_BUILD_NOTE set.
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 02 Mar 2017 17:10:08 +0000
- Subject: Commit: objcopy: Support merging of notes without SHF_GNU_BUILD_NOTE set.
- Authentication-results: sourceware.org; auth=none
Hi Guys,
I am applying the patch below to allow objcopy's new note merging
feature to work with .gnu.build.attribute sections that do not have
the SHF_GNU_BUILD_NOTE flag set. This is to support the generation of
these notes by older versions of GAS, versions which are unable to set
OS specific section flags.
Cheers
Nick
binutils/ChangeLog
2017-03-02 Nick Clifton <nickc@redhat.com>
* objcopy.c (is_merged_note_section): Support build note sections
without the SHF_GNU_BUILD_NOTE section flag set.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index baf6990..868f122 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1217,7 +1217,11 @@ is_merged_note_section (bfd * abfd, asection * sec)
&& elf_section_data (sec)->this_hdr.sh_type == SHT_NOTE
/* FIXME: We currently only support merging GNU_BUILD_NOTEs.
We should add support for more note types. */
- && elf_section_data (sec)->this_hdr.sh_flags & SHF_GNU_BUILD_NOTE)
+ && ((elf_section_data (sec)->this_hdr.sh_flags & SHF_GNU_BUILD_NOTE) != 0
+ /* Old versions of GAS (prior to 2.27) could not set the section
+ flags to OS-specific values, so we also accept sections with the
+ expected name. */
+ || (strcmp (sec->name, GNU_BUILD_ATTRS_SECTION_NAME) == 0)))
return TRUE;
return FALSE;