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] Put warning into documentation of attribute "regparm"


> > + 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).

As I said, I'm entirely unaware of these issues. I just picked a random 
patch from GNATS. I'd be really happy if you could suggest some wording, 
or extend the patch.

Thanks
  Wolfgang

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/



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