This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 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.
---
 This fixes:

FAIL: strip on STB_GNU_UNIQUE

revealed with the `v850-elf' target and an upcoming change to widen 
STB_GNU_UNIQUE testing.  I can see no discussion about the choice to 
switch from ELFOSABI_GNU to ELFOSABI_NONE here: 
<https://sourceware.org/ml/binutils/2015-02/msg00342.html>, so I take it 
it is a bug that has been papered over.

 No regressions in `v850-elf' testing.  OK to apply?

  Maciej

binutils-v850-bfd-copy-private-bfd-data.diff
Index: binutils/bfd/elf32-v850.c
===================================================================
--- binutils.orig/bfd/elf32-v850.c	2016-05-15 23:11:36.754321222 +0100
+++ binutils/bfd/elf32-v850.c	2016-05-16 00:59:04.276879239 +0100
@@ -2428,10 +2428,10 @@ v850_elf_set_note (bfd * abfd, enum v850
   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 * ib
      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 * ib
       /* 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
 
Index: binutils/binutils/testsuite/binutils-all/objcopy.exp
===================================================================
--- binutils.orig/binutils/testsuite/binutils-all/objcopy.exp	2016-05-15 23:11:36.000000000 +0100
+++ binutils/binutils/testsuite/binutils-all/objcopy.exp	2016-05-16 01:06:40.953791016 +0100
@@ -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"
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]