This is the mail archive of the 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] Fix -fpic/-fPIC virtual thunks on s390 -m31

Hi Jakub,

> s390 31-bit .plt slots require %r12 to be loaded with .plt's shared library
> _GLOBAL_OFFSET_TABLE_. As we cannot load that (%r12 is call-saved and we
> don't return back into the thunk (we would have to copy arguments otherwise
> and we don't know how many there are), we cannot use .plt.

I had thought that in this case, the call to the thunk would count as
call to a non-local function and thus the caller would have to set up
the GOT pointer.  Is this not the case?  (If not, can it be arranged?
That would certainly be the best solution.)

> The following patch changes 31-bit thunks calling to non-local functions
> in -fpic/-fPIC to load the function pointer from .got instead.

This effectively disables lazy binding.  Recent binutils support
@GOTPLT (or was it @PLTGOT?); that would be preferable ...

> Ok to commit (or are different sequences better)?

These sequences are quite ugly w.r.t. pipeline stalls.  Unfortunately
it's hard to do better in such a small amount of code.  I'll have to
think about this a bit.


  Dr. Ulrich Weigand

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