This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: perl-5.14.4


On Feb 15 14:18, Achim Gratz wrote:
> Corinna Vinschen writes:
> > objcopy might be able to do that, but the pe/coff format is fiddly.
> 
> Well, the problem is that I can't set the section address back to what
> it was since the interpretation of the numbers on the command line seems
> to be limited somehow.  So instead of 0x56628f000 I end up with an
> adress of 0x46628f000 and no amount of fiddling gets it any larger.  If
> I try with an address of -1 then the resulting section address is
> 0x3ffffffff.  The info manual is close to useless and doesn't even try
> to talk about how one is supposed to specify larger numbers ("L", "LL"
> and "ULL" suffixes don't work, I've tried that).
> 
> >> but I think that this section
> >> should not be rebased.
> >
> > Provided that this *is* the problem, this should be easily doable in
> > rebase.  The core is a function Relocations::relocate in
> > imagehelper/sections.cc.  At one point in the loop it calls
> >
> >   Section *cursec = sections->find(va);
> >
> > At this point it should be possible to check against the section
> > name and filter out all sections starting with ".debug_"
> 
> I don't see how, but maybe I'm not looking at it right.  The rebasing is
> done by some windows function AFICS

Where?  rebase.c calls ReBaseImage64, which is

a) a Windows function in imagehlp.dll and
b) the function name of a function in the imagebase library, implemented
   in rebaseimage.cc.

We're going path b.  The core of imagebase's implementation of
ReBaseImage64 is the call to LinkedObjectFile::performRelocation (line
123 in imagehelper/rebaseimage.cc), which in turn calls
Relocations::relocate in imagehelper/sections.cc.  This function
performs the actual relocation.

> that doesn't seem to allow
> individual sections to be skipped.  The code you pointed at seems just
> to be checking if any sections need additional fixups.

Well, it's the code doing the actual relocation.  The outer for-loop
jumps from relocation block to relocation block.  Line 391

  Section *cursec = sections->find(va);

computes the actual section the relocation block is pointing to.
Then it checks if it points to a valid section and if not it bails
out.  Otherwise it loops over the relocation entries in the block
and performas the actual relocation.

The idea is to add something along the lines of

  if (cursec && !strncmp (cursec->getName (), ".debug_", 7))
    continue;


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpeSjyTJTWIW.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]