PATCH: PR binutils/13947: Strip applied twice corrupts binaries compiled with --emit-relocs

Alan Modra amodra@gmail.com
Fri Apr 13 01:45:00 GMT 2012


On Thu, Apr 12, 2012 at 09:34:40AM -0700, H.J. Lu wrote:
> binutils/
> 
> 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	PR binutils/13947
> 	* objcopy.c (copy_object): Call copy_relocations_in_section
> 	before copy_section.
> 	(skip_section): New.
> 	(copy_relocations_in_section): Likewise.
> 	(copy_section): Use skip_section.  Don't copy relocations here.
> 
> binutils/testsuite/
> 
> 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
> 
> 	PR binutils/13947
> 	* binutils-all/i386/compressed-1b.d: Remove empty REL section.
> 	* binutils-all/i386/compressed-1c.d: Likewise.
> 
> 	* binutils-all/x86-64/compressed-1b.d: Remove empty RELA
> 	section.
> 	* binutils-all/x86-64/compressed-1c.d: Likewise.

OK, but please remove the comment about not copying reloc info before
copy_section, since copy_section no longer handles relocs.

> +/* Copy the data of input section ISECTION of IBFD
> +   to an output section with the same name in OBFD.
> +   If stripping then don't copy any relocation info.  */
> +
> +static void
> +copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list