[patch objcopy]: Don't strip .reloc section by default for pe-coff

Kai Tietz ktietz70@googlemail.com
Fri Oct 5 13:20:00 GMT 2012


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);



More information about the Binutils mailing list