This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR binutils/13947: Strip applied twice corrupts binaries compiled with --emit-relocs
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 13 Apr 2012 10:55:40 +0930
- Subject: Re: PATCH: PR binutils/13947: Strip applied twice corrupts binaries compiled with --emit-relocs
- References: <20120412163440.GA16281@intel.com>
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