This is the mail archive of the gcc-help@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: handling of symbol prefixes in the "target" of the alias("target") attribute


Mike Frysinger <vapier@gentoo.org> writes:

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

Something like that would be appropriate, but I'm not sure the wording
here is quite right.  I look at the docs for the -fleading-underscore
option, but they are pretty weak.

Ian

> --- 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]