Re: handling of symbol prefixes in the "target" of the alias("target") attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 27 May 2009 00:41:42 Ian Lance Taylor wrote:
> Mike Frysinger <vapier@xxxxxxxxxx> writes:
> > i'm wondering whether it is expected that the "target" of the alias()
> > attribute should automatically handle the symbol prefix
> > (__USER_LABEL_PREFIX__).  the documentation doesnt mention anything along
> > these lines, but going by existing ports like Windows and Blackfin/Linux,
> > it would seem that they do.  however, it seems like Apple's gcc fork does
> > not. it also seems more logical for the prefix to be handled
> > transparently rather than forcing everyone to do magic CPP crap with
> > __USER_LABEL_PREFIX__. -mike
>
> As far as I know it was never documented.  However, every target that I
> checked does add __USER_LABEL_PREFIX__ before the alias name.

perhaps this change would be appropriate then ?

--- trunk/gcc/doc/extend.texi	(revision 147891)
+++ trunk/gcc/doc/extend.texi	(working copy)
@@ -1868,8 +1868,8 @@ void __f () @{ /* @r{Do something.} */; 
 void f () __attribute__ ((weak, alias ("__f")));
 @end smallexample
 
-defines @samp{f} to be a weak alias for @samp{__f}.  In C++, the
-mangled name for the target must be used.  It is an error if @samp{__f}
+defines @samp{f} to be a weak alias for the C visible @samp{__f}.  In C++,
+the mangled name for the target must be used.  It is an error if @samp{__f}
 is not defined in the same translation unit.
 
 Not all target machines support this attribute.
@@ -3308,8 +3308,8 @@ and linker.
 @cindex @code{weakref} attribute
 The @code{weakref} attribute marks a declaration as a weak reference.
 Without arguments, it should be accompanied by an @code{alias} attribute
-naming the target symbol.  Optionally, the @var{target} may be given as
-an argument to @code{weakref} itself.  In either case, @code{weakref}
+naming the target (C visible) symbol.  Optionally, the @var{target} may be
+given as an argument to @code{weakref} itself.  In either case, 
@code{weakref}
 implicitly marks the declaration as @code{weak}.  Without a
 @var{target}, given as an argument to @code{weakref} or to @code{alias},
 @code{weakref} is equivalent to @code{weak}.

-mike

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux