This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix -fpic/-fPIC virtual thunks on s390 -m31
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: jakub at redhat dot com
- Cc: weigand at i1 dot informatik dot uni-erlangen dot de (Ulrich Weigand), gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Jun 2003 18:56:11 +0200 (MET DST)
- Subject: Re: [PATCH] Fix -fpic/-fPIC virtual thunks on s390 -m31
> 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