This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Adjust relocation type secrel for w64 and fix base-file/dlltool functionality


Hi Nick,

Nick Clifton <nickc@redhat.com> wrote on 02.09.2008 08:44:08:

> Hi Kai,
> 
> > The patch was tested for x86_64-pc-mingw32. The secrel issue is, that 
PE+ 
> > has to use DIR64 for relocation and there is not suitable 32-bit 
ImageBase 
> > relocation present. The R_(I386|AMD64)_SECREL isn't a real coff 
> > relocation. It is mainly used for dwarf2. The problem fixed by this 
patch 
> > are the base relocations for w64 target for secrel (the second patch I 

> > sent for gas supporting .secrel64 is part necessary, too). dlltool 
emits 
> > at the moment HIGHLOW relocations, which have to be altered into DIR64 

> > relocations for w64 and the size of the vma's have to be changed to 
> > bfd_vma instead of 'long' stored in the base-file.
> > 
> > Some test in the testsuite needs to be reworked completly for w64 in 
gas 
> > and ld. But first I wanted to get some response about the patch before 

> > adjusting them.
> 
> Ok - well the patch is approved, so please go ahead and apply it (and 
> adjust the testsuite entries).

Ok, I will prepare an new patch for this with testsuite adjustments and 
includubg the gas part, too.
As long as gcc uses 32-bit relocations I won't modify the 32-bit secrel to 
be 64-bit.

> > The most interesting question here is, if it wouldn't be better to 
alter 
> > the dwarf2 code for mingw in general. The idea was - as I spoke to 
Aaron 
> > about it - to use instead of .secrel for dwarf2 .rva an use the global 

> > __image_base to relocate the dwarf2 code. So we could get rid of the 
> > necessarity of base relocations in debug section at all and the 
> > implementation would be more near to the unix one.
> 
> Hmm, whilst it might be neater and simpler to be more like the unix 
> implementation, would it actually solve any outstanding problems with 
> the current system ?

The interesting point about this approach is, that we could get rid of the 
need to have relocations in debug-section and dwarf2 information at all 
and that 32-bit dwarf2 can be supported for w64, too. Otherwise w64 has to 
use 64-bit dwarf2, which consumes much more space.

Cheers,
Kai

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


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