This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: effect of -fPIC on code speed
- From: Andrew Haley <aph at redhat dot com>
- To: Jay K <jay dot krell at cornell dot edu>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 22 Sep 2010 09:00:00 +0100
- Subject: Re: effect of -fPIC on code speed
- References: <1285119859.23319.ezmlm@gcc.gnu.org> <COL101-W218B9D81B85D1CCB70AAD2E6600@phx.gbl>
On 22/09/10 05:58, Jay K wrote:
>
> >> It's actually part of the C standard: there may only be one definition
> >> of any symbol, whether that symbol refers to a function or to data. So,
> >> for every visible symbol X in a program, &X must be the same, no matter
> >> who is asking.
>
> >> All manner of things break without this.
>
>
> Some stuff breaks, but not much.
LOL! Not enough to matter, right? :-)
> It's pretty rare to compare the addresses of globals/functions for equality.
Perhaps, but that's not the only problem when there are multiple instances
of X. RTTI and exception handling, for example, break.
Andrew.