what does the weak_alias function do and where is it defined : <p>So I'm looking through the source of gcc compiler and I've come along this in fork.c:</p>

<pre><code>int
__fork ()
{
  __set_errno (ENOSYS);
  return -1;
}
libc_hidden_def (__fork)
stub_warning (fork)

weak_alias (__fork, fork)
#include &lt;stub-tag.h&gt;
</code></pre>

<p>I'm trying to figure out what weak_alias does. I've used the grep command inside the glibc source files to find all occurrences of #define weak_alias:</p>

<pre><code>grep -r "#define weak_alias"
</code></pre>

<p>I've found many occurrences of the macro:</p>

<pre><code>#define weak_alias(n, a)
</code></pre>

<p>but the macros don't actually explain anything. They just define that statement they don't show how its being replaced. For example one occurrence is in profil.c:</p>

<pre><code>/* Turn off the attempt to generate ld aliasing records. */
#undef weak_alias
#define weak_alias(a,b)
</code></pre>

<p>So any ideas what weak_alias does and where it is being defined?</p>

<p>Thanks in advance</p>
