This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch objcopy]: Don't strip .reloc section by default for pe-coff
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Fri, 5 Oct 2012 15:20:01 +0200
- Subject: [patch objcopy]: Don't strip .reloc section by default for pe-coff
Hi,
this patch adjusts that by default objcopy doesn't strip .reloc
sections, if user specifies strip-all, as "reloc" section has special
meaning for pe-coff.
Tested for x86_&4-w64-mingw32, i686-pc-cygwin, and i686-w64-mingw32.
Ok for apply?
Regards,
Kai
ChangeLog binutils
2012-10-05 Kai Tietz
* objcopy.c (is_strip_section_1): Don't strip
.reloc section by default.
Index: binutils/objcopy.c
===================================================================
RCS file: /cvs/src/src/binutils/objcopy.c,v
retrieving revision 1.157
diff -u -p -r1.157 objcopy.c
--- binutils/objcopy.c 8 May 2012 17:49:36 -0000 1.157
+++ binutils/objcopy.c 1 Oct 2012 14:54:27 -0000
@@ -977,7 +977,10 @@ is_strip_section_1 (bfd *abfd ATTRIBUTE_
|| strip_symbols == STRIP_ALL
|| discard_locals == LOCALS_ALL
|| convert_debugging)
- return TRUE;
+ {
+ if (strcmp (bfd_get_section_name (abfd, sec), ".reloc") != 0)
+ return TRUE;
+ }
if (strip_symbols == STRIP_DWO)
return is_dwo_section (abfd, sec);