RFA: broken strip/objcopy

Kai Tietz Kai.Tietz@onevision.com
Fri Apr 24 13:55:00 GMT 2009


binutils-owner@sourceware.org wrote on 24.04.2009 15:41:47:

> On Fri, Apr 24, 2009 at 6:00 AM, Kai Tietz <ktietz70@googlemail.com> 
wrote:
> > Hello,
> >
> > 2009/4/24 Kai Tietz <ktietz70@googlemail.com>:
> >> Hello,
> >>
> >> The current implementation of objcopy/strip in binutils has problems,
> >> because for pe-coff targets. It assumes at the moment that it is an
> >> i386 version. This leads to issues (especially on strip) for PE+
> >> target that binaries are getting corrupted. So I think we have here 
to
> >> move those target specific pe-coff parts into seperate files. (I
> >> assume that possibly for othe pe-coff targets then i386 the same
> >> problem exists). Of course we could use here target specific macros 
to
> >> change internal structures, but for a mulilib version of them this
> >> isn't suitable anymore.
> >> So possible somebody of you have a strong opinion about how this 
issue
> >> could be solved. I'll prepare a patch for it and post it soon.
> >
> > Ah, I found the major issue here
> >
> > 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
> >
> >        PR binutils/10074
> >
> > This patch made objcopy and strip for PE-Coff target 32-bit PE only
> 
> I am trying to understand where the problem is. pe->pe_opthdr is
> supposed to target independent. Why doesn't it work for w64?

The issue here is that pep has an different structure for optional header. 
Therefore the structure here has a different size. This is dependent to 
the target type (See the defines I added in the new module for it).

Cheers,
Kai

Regards,
 i.A. Kai Tietz

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.



More information about the Binutils mailing list