Weak alias to mock
<p>I'm trying to mock a fn say foo using </p>

<pre><code>#ifdef UT_TEST
    void foo(void)  __attribute__ ((weak, alias ("foo_impl")));
#else
    void foo(void);
#endif
</code></pre>

<p>However, is there a way to do this @ runtime instead of compile time? I cannot use C++, for historical reasons.</p>