This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch s390] Allow ofsetted GOT references


On Mon, 2006-10-09 at 15:12 +0200, Ulrich Weigand wrote: 
> In principle, the change should be OK, however I seem to recall that
> there was a reason for not allowing offset for GOT relocations; maybe
> some old version of binutils or modutils didn't handle those correctly ...
> 
> 
> Martin, what DJ wants to do here is to get GCC to generate code like
> 
>         l       %r2,test@GOT+4(%r12)
> 
> to address the low half of a GOT slot on 64-bit, which would get
> translated into a relocation like
> 
>   10:   58 20 c0 00             l       %r2,0(%r12)
>                         12: R_390_GOT12 test+0x4
> 
> I seem to recall some versions of the toolchain treating this as
> reference to a GOT slot holding the address of test+4, instead of
> a reference to 4 bytes into the GOT slot holding the address of
> test.  Do you remember any details about this?

The "+4" part of the relocation is added to the offset that is part of
the instruction. test@GOT+4 evaluates to the offset of "test" in the
global offset table plus 4. The got offset is changed, not the value
stored in the got.

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.



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