]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 4479
authorAlan Modra <amodra@gmail.com>
Fri, 11 May 2007 14:09:50 +0000 (14:09 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 11 May 2007 14:09:50 +0000 (14:09 +0000)
* objcopy.c (copy_object): Don't copy ELF program headers for
--only-keep-debug.

binutils/ChangeLog
binutils/objcopy.c

index f5f0b58faf54c6706a39284ec7b890055d8b9443..6affdfdff04a92f4129180e9fb31af13ed22c55e 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-11  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 4479
+       * objcopy.c (copy_object): Don't copy ELF program headers for
+       --only-keep-debug.
+
 2007-05-11  Alan Modra  <amodra@bigpond.net.au>
 
        * embedspu.sh (find_prog): Prefer prog in same dir as embedspu
index ef57c2bf4ae045d9670b0355e9f3c149afa5256e..a841e014d40ceb4ee8e89e1cb25eb4b3dcd299c2 100644 (file)
@@ -1423,7 +1423,12 @@ copy_object (bfd *ibfd, bfd *obfd)
      any output is done.  Thus, we traverse all sections multiple times.  */
   bfd_map_over_sections (ibfd, setup_section, obfd);
 
-  setup_bfd_headers (ibfd, obfd);
+  /* Don't copy headers when creating an ELF format debug info file.  */
+  if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour
+      && strip_symbols == STRIP_NONDEBUG)
+    ;
+  else
+    setup_bfd_headers (ibfd, obfd);
 
   if (add_sections != NULL)
     {