[PATCH] Handle weak symbols

Mark Mitchell mark@codesourcery.com
Mon May 7 22:55:00 GMT 2001


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

  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.

  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.

Yours,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com



More information about the Gcc-patches mailing list