This is the mail archive of the gcc-patches@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]

Re: [PATCH] Handle weak symbols


On Monday 07 May 2001 04:04, Mark Mitchell wrote:
> OK, now I understand the problem, and I agree that there's a bug
> here.  That's one step. :-)  By the way, you left out the rtlanal.c
> patch in your original posting, but I can imagine it. :-)

Oops, sorry.

> I don't fully understand what you're proposing from this:
>
>   - is_on_pragma_weak_list() walking the (usually short) #pragma weak list
>   - add_pragma_weak() called from the #pragma handling
>   - is_on_assembled_weak_list() called from the assemble_* functions and
>   weak_finish()
>   - add_weak() called from the assemble_* functions

I looked a bit more yesterday and I don't think this will work as I thought. 
It seems the expectation here is that SUPPORTS_WEAK=1 platforms output a weak 
into asm for each weak declaration, even though it was never used 
(make_decl_rtl never called on it). I have no other explanation why one would 
maintain this list at all otherwise. If this is not superflous, then the only 
easy way to solve that is either my separate list for #pragma weaks or  your 
hashing suggestion.

And here an example of the glibc code that caused me to disable the error:

const int __old_sys_nerr = 123 ;
 
extern __typeof (  __old_sys_nerr  )     _old_sys_nerr   __attribute__ 
((alias ("__old_sys_nerr")));  ;
extern __typeof (  __old_sys_nerr  )     _old_sys_nerr   __attribute__ 
((weak, alias ("__old_sys_nerr")));

Franz.


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