objcopy --extract-symbol
authorAlan Modra <amodra@gmail.com>
Thu, 15 Oct 2015 11:03:38 +0000 (21:33 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 15 Oct 2015 13:08:29 +0000 (23:38 +1030)
Calling bfd_copy_private_bfd_data is necessary to copy ELF file header
info.

binutils/
* objcopy.c (copy_object): Don't omit bfd_copy_private_bfd_data
call when extract_symbol.
bfd/
* elf32-v850.c (v850_elf_copy_private_bfd_data): Remove assertion
that input and output .note.renesas sections are same size.
Instead, only copy input to output if they are.

bfd/ChangeLog
bfd/elf32-v850.c
binutils/ChangeLog
binutils/objcopy.c

index 88b7b862e944d0c83274e13dbdc6e9dc8b970b59..77e33e4e05ad59726407346c62655e2d7c5611bc 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-15  Alan Modra  <amodra@gmail.com>
+
+       * elf32-v850.c (v850_elf_copy_private_bfd_data): Remove assertion
+       that input and output .note.renesas sections are same size.
+       Instead, only copy input to output if they are.
+
 2015-10-15  Riku Voipio  <riku.voipio@iki.fi>
 
        PR ld/19123
index c6a6d2fa7aff1e8be740e91b9611627e0c3a17b2..47733243da6d2b221713612918eb2cd78e5096cb 100644 (file)
@@ -2442,13 +2442,14 @@ v850_elf_copy_private_bfd_data (bfd * ibfd, bfd * obfd)
   if ((onotes = bfd_get_section_by_name (obfd, V850_NOTE_SECNAME)) == NULL)
     return TRUE;
 
-  if ((inotes = bfd_get_section_by_name (ibfd, V850_NOTE_SECNAME)) != NULL)
+  if ((inotes = bfd_get_section_by_name (ibfd, V850_NOTE_SECNAME)) == NULL)
+    return TRUE;
+
+  if (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes))
     {
       bfd_byte * icont;
       bfd_byte * ocont;
 
-      BFD_ASSERT (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes));
-
       if ((icont = elf_section_data (inotes)->this_hdr.contents) == NULL)
        BFD_ASSERT (bfd_malloc_and_get_section (ibfd, inotes, & icont));
 
index ce3ac62596c161e4aebf170da952d4e5de87c48b..9433f3d7ef8bcfacc2d9b477a53c322ef554b9b8 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-15  Alan Modra  <amodra@gmail.com>
+
+       * objcopy.c (copy_object): Don't omit bfd_copy_private_bfd_data
+       call when extract_symbol.
+
 2015-10-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * od-elf32_avr.c (elf32_avr_dump_avr_prop): Fix printing of align
index 2cd55fd7129a0e9417b532c65c32135cc52e6ea6..324456aaf212ce93cd74dc3079b0ebf0f30863e4 100644 (file)
@@ -2305,11 +2305,6 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
        }
     }
 
-  /* Do not copy backend data if --extract-symbol is passed; anything
-     that needs to look at the section contents will fail.  */
-  if (extract_symbol)
-    return TRUE;
-
   /* Allow the BFD backend to copy any private data it understands
      from the input BFD to the output BFD.  This is done last to
      permit the routine to look at the filtered symbol table, which is
This page took 0.029339 seconds and 4 git commands to generate.