This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Put warning into documentation of attribute "regparm"
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- To: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, user42 at zip dot com dot au
- Date: Thu, 15 May 2003 17:40:30 +1000
- Subject: Re: [Patch] Put warning into documentation of attribute "regparm"
- References: <Pine.LNX.firstname.lastname@example.org>
On 15-May-2003, Wolfgang Bangerth <email@example.com> wrote:
> + Beware that on some ELF systems this attribute is unsuitable for
> + global functions in shared libraries. Lazy binding will send the
> + first call via resolving code in the loader, which might assume EAX,
> + EDX and ECX can be clobbered, as per the standard calling conventions.
> + Solaris 8 is affected by this. GNU systems with GLIBC 2.1 or higher,
> + and FreeBSD, are believed to be safe though since the loaders there
> + save all registers.
That is certainly useful information to have in the manual.
However, presumably the problem could be worked around by just not using
lazy binding, e.g. by linking with `-z now'?
If so, saying that the attribute is "unsuitable for
global functions in shared libraries" is a little bit too strong.
"unsuitable for global functions in shared libraries that use lazy binding"
would be more accurate (and then you could mention that lazy binding is
the default, and how to disable it).
Fergus Henderson <firstname.lastname@example.org> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.