[binutils-gdb] Remove references to the unofficial SHF_GNU_BUILD_NOTE section flag.

Nick Clifton nickc@sourceware.org
Mon Dec 7 16:18:26 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=846141822b5d8f6ecc549ce98be474522b95d9cb

commit 846141822b5d8f6ecc549ce98be474522b95d9cb
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Dec 7 16:17:40 2020 +0000

    Remove references to the unofficial SHF_GNU_BUILD_NOTE section flag.
    
    binutils        * objcopy.c (is_mergeable_note_section): Remove reference to
            SHF_GNU_BUILD_NOTE.
    
    include * elf/common.h (SHF_GNU_BUILD_NOTE): Delete.

Diff:
---
 binutils/ChangeLog   | 5 +++++
 binutils/objcopy.c   | 6 +-----
 include/ChangeLog    | 4 ++++
 include/elf/common.h | 1 -
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 5f6d98f0701..d139b1365f7 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-07  Nick Clifton  <nickc@redhat.com>
+
+	* objcopy.c (is_mergeable_note_section): Remove reference to
+	SHF_GNU_BUILD_NOTE.
+
 2020-12-07  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
 	PR 26945
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 04ba95ec140..06ecf3e9704 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1311,11 +1311,7 @@ is_mergeable_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) != 0
-	  /* Old versions of GAS (prior to 2.27) could not set the section
-	     flags to OS-specific values, so we also accept sections that
-	     start with the expected name.  */
-	  || (CONST_STRNEQ (sec->name, GNU_BUILD_ATTRS_SECTION_NAME))))
+      && (CONST_STRNEQ (sec->name, GNU_BUILD_ATTRS_SECTION_NAME)))
     return TRUE;
 
   return FALSE;
diff --git a/include/ChangeLog b/include/ChangeLog
index 81486ad7cbd..ebda223cb11 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-07  Nick Clifton  <nickc@redhat.com>
+
+	* elf/common.h (SHF_GNU_BUILD_NOTE): Delete.
+
 2020-12-01  Nelson Chu  <nelson.chu@sifive.com>
 
 	* opcode/riscv.h (RISCV_UNKNOWN_VERSION): added.
diff --git a/include/elf/common.h b/include/elf/common.h
index 95a852f0cf5..6482f8c0bd1 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -553,7 +553,6 @@
 
 /* #define SHF_MASKOS	0x0F000000    *//* OS-specific semantics */
 #define SHF_MASKOS	0x0FF00000	/* New value, Oct 4, 1999 Draft */
-#define SHF_GNU_BUILD_NOTE    (1 << 20)	/* Section contains GNU BUILD ATTRIBUTE notes.  */
 #define SHF_GNU_RETAIN	      (1 << 21)	/* Section should not be garbage collected by the linker.  */
 #define SHF_MASKPROC	0xF0000000	/* Processor-specific semantics */


More information about the Binutils-cvs mailing list