aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/objcopy.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index f5f0b58..6affdfd 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,11 @@
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
over one found on the users path.
(main): Generate .reloc for each R_SPU_PPU* reloc.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index ef57c2b..a841e01 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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)
{