RFC: weakref GCC attribute and .weakref assembly directive

Alexandre Oliva aoliva@redhat.com
Tue Oct 18 17:44:00 GMT 2005


On Oct 13, 2005, Daniel Jacobowitz <drow@false.org> wrote:

> On Thu, Oct 13, 2005 at 08:33:01AM -0500, Aaron W. LaFramboise wrote:
>> Could you compare your novel weak references to PECOFF's notion of "weak 
>> externals"?
>> 
>> .weak sym1 = sym2  # Analogous to: .weakref sym1, sym2

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

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the Gcc mailing list