http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51643

--- Comment #6 from Alexander Osipenko <sipych at gmail dot com> 2011-12-20 
23:33:06 UTC ---
It seems reasonable to expect minimal consistency, either generating invalid
(zero for example) reference for any direct weak function call, better marking
it with "warning" or even "error" message, or not depending on the optimization
options.

In any case, the semantics of weak referencies is beyond of the C standard
scope,
so even "if( wfunc ) wfunc();" may be treated only in terms of reasonable
consistency.

EABI specification follows a simple rule: "call to undefined weak function do
nothing".
Just the same do "if( wfunc ) wfunc();", a little bit longer, if we believe
that undefined wfunc == 0 always, but not 0xDEADBEEF eventually when optimized.

Reply via email to