[binutils-gdb] V850/BFD: Call `_bfd_elf_copy_private_bfd_data' again

Maciej W.Rozycki macro@sourceware.org
Mon May 16 12:32:00 GMT 2016


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

commit 71de341392d18d7951b5a00fe68b6309e2dfbb47
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Mon May 16 08:22:59 2016 +0100

    V850/BFD: Call `_bfd_elf_copy_private_bfd_data' again
    
    Correct a regression introduced with commit 685080f21003 ("Adds support
    for generating notes in V850 binaries.") which replaced rather than
    extending the call to `_bfd_elf_copy_private_bfd_data' with
    `v850_elf_copy_private_bfd_data'.  Consequently ELFOSABI_GNU marking is
    not propagated to output by `objcopy' from objects containing
    STB_GNU_UNIQUE symbols.
    
    	bfd/
    	* elf32-v850.c (v850_elf_copy_notes): New function, factored out
    	from...
    	(v850_elf_copy_private_bfd_data): ... here.  Call the new
    	function and `_bfd_elf_copy_private_bfd_data'.
    
    	binutils/
    	* testsuite/binutils-all/objcopy.exp: Don't skip the `strip-10'
    	test for the V850.

Diff:
---
 bfd/ChangeLog                               |  7 +++++++
 bfd/elf32-v850.c                            | 19 +++++++++++++------
 binutils/ChangeLog                          |  5 +++++
 binutils/testsuite/binutils-all/objcopy.exp |  2 --
 4 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9583ebd..9f1bb70 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2016-05-16  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* elf32-v850.c (v850_elf_copy_notes): New function, factored out
+	from...
+	(v850_elf_copy_private_bfd_data): ... here.  Call the new
+	function and `_bfd_elf_copy_private_bfd_data'.
+
 2016-05-13  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/20093
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 3df0e0e..8f73d32 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -2428,10 +2428,10 @@ v850_elf_set_note (bfd * abfd, enum v850_notes note, unsigned int val)
   return TRUE;
 }
 
-/* Copy backend specific data from one object module to another.  */
+/* Copy a v850 note section from one object module to another.  */
 
-static bfd_boolean
-v850_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
+static void
+v850_elf_copy_notes (bfd *ibfd, bfd *obfd)
 {
   asection * onotes;
   asection * inotes;
@@ -2440,10 +2440,10 @@ v850_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
      skip the merge.  The normal input to output section
      copying will take care of everythng for us.  */
   if ((onotes = bfd_get_section_by_name (obfd, V850_NOTE_SECNAME)) == NULL)
-    return TRUE;
+    return;
 
   if ((inotes = bfd_get_section_by_name (ibfd, V850_NOTE_SECNAME)) == NULL)
-    return TRUE;
+    return;
 
   if (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes))
     {
@@ -2459,8 +2459,15 @@ v850_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
       /* Copy/overwrite notes from the input to the output.  */
       memcpy (ocont, icont, bfd_section_size (obfd, onotes));
     }
+}
 
-  return TRUE;
+/* Copy backend specific data from one object module to another.  */
+
+static bfd_boolean
+v850_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+  v850_elf_copy_notes (ibfd, obfd);
+  return _bfd_elf_copy_private_bfd_data (ibfd, obfd);
 }
 #define bfd_elf32_bfd_copy_private_bfd_data	v850_elf_copy_private_bfd_data
 
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 9170c00..57802e8 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-16  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* testsuite/binutils-all/objcopy.exp: Don't skip the `strip-10'
+	test for the V850.
+
 2016-05-11  Andrew Bennett  <andrew.bennett@imgtec.com>
 
 	* readelf.c (print_mips_ases): Add DSPR3.
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index c348578..176764a 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1061,11 +1061,9 @@ if [is_elf_format] {
     run_dump_test "strip-9"
     run_dump_test "strip-12"
     # Non-EABI ARM targets will set OSABI to ARM
-    # The V850 sets the OSABI to UNIX - System V
     if { ![istarget "*-*-hpux*"]
 	 && ![istarget "msp*-*-*"]
 	 && ![istarget "visium-*-*"]
-	 && ![istarget "v850*-*-*"]
          && !([istarget "arm*-*-*"] && ![istarget "arm-*-*eabi*"])} {
 	run_dump_test "strip-10"
     }



More information about the Binutils-cvs mailing list