This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Software Convention Proposal
- From: Richard Henderson <rth at redhat dot com>
- To: "Sehr, David C" <david dot c dot sehr at intel dot com>
- Cc: "Kirkegaard, Knud J" <knud dot j dot kirkegaard at intel dot com>, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>, "Saxena, Sunil" <sunil dot saxena at intel dot com>, "'cary at cup dot hp dot com'" <cary at cup dot hp dot com>, "Winalski, Paul" <paul dot winalski at intel dot com>
- Date: Thu, 5 Sep 2002 11:41:07 -0700
- Subject: Re: Software Convention Proposal
- References: <25282B06EFB8D31198BF00508B66D4FA04BE8593@fmsmsx114.fm.intel.com>
On Thu, Sep 05, 2002 at 11:18:14AM -0700, Sehr, David C wrote:
> If I understand what you are saying about building a shared library,
> then without -fpic the following global symbol visibility rules apply:
> 1) if a symbol is defined, it is treated as protected (and made gprel if
> short)
> 2) if a symbol is extern (or, I presume, common), it is treated as default
Correct.
> The error from the linker then comes from having an extern reference
> to a defined symbol in another .o.
Not exactly. The symbol might not be defined anywhere else. But
if the symbol appears in the dynamic symbol table, we'll generate
an error because we cannot (and don't want to) represent the gprel
relocation in the dynamic relocation table.
r~