This is the mail archive of the gcc@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: Software Convention Proposal


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~


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