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: RFC: weakref GCC attribute and .weakref assembly directive


Alexandre Oliva wrote:
On Oct 13, 2005, Daniel Jacobowitz <drow@false.org> wrote:
>
The difference is that ".weak sym1 = sym2" resolves to sym1 (if
available) else sym2; but ".weakref sym1, sym2" resolves to sym2 (if
available) else zero.  Also sym1 does not become an external, only a
local alias, IIRC.

Yep. In `.weak sym1 = sym2', sym1 is a weak alias, which I actually contrast with a weakref in the spec text I posted.

Well, that syntax is specific to the PE port as far as I know, and the semantics don't quite match weak aliases, which I understand to be the equivilent of:


	.set	sym1, sym2
	.weak	sym1

For instance, in PECOFF 'weak externals' (probably a rather misleading name),

> A weak alias cannot reference an undefined symbol, weak or strong.

this statement is not true. This is because PECOFF's 'weak externals' are actually a unique storage class, and so it can do special stuff.

But thank you guys for your help; it answers my question.


Aaron W. LaFramboise



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