This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Handle weak symbols
At 07:55 08.05.2001, Mark Mitchell wrote:
> >>>>> "Andreas" == Andreas Jaeger <aj@suse.de> writes:
>
> Andreas> Are Franz' patches broken or not? I'd rather see this
> Andreas> fixed now on the mainline.
>
>Broken is a strong term.
>
>They are not sufficiently perfect at this point.
>
>I think the right way to do this is, in broad strokes:
>
> 1. The front-end sets DECL_WEAK when it creates a declaration
> for which `#pragma weak' has been seen. This is easy,
> but we should still use a data structure smarter than a
> linked list to store the list of `#pragma weak' names.
I don't think it's worth to do that for a seldom used #pragma weak.
> 2. Similarly, if the declaration already exists, it is marked
> DECL_WEAK when a `#pragma weak' is seen.
>
> This step is non-trivial, but doable. We could perhaps also make
> it illegal to use `#pragma weak' after the function has already
> been declared, which would obviate this step. After all,
> GNU code will use __attribute__, not #pragma.
That was my intention for a followup patch.
> 2. make_decl_rtl should set SYMBOL_REF_WEAK from DECL_WEAK, as
> per Franz's patch.
>
> 3. rtx_addr_can_trap_p should check SYMBOL_REF_WEAK as per
> Franz's patch.
As you seem to agree with my way to implement these 2 points, can only that
go in? These 2 are enough to fix the glibc problem for now. We can work on
the rest of the patch in the mainline.
Franz.