weak_alias函数做什么,它在哪里定义 [英] what does the weak_alias function do and where is it defined

查看:453
本文介绍了weak_alias函数做什么,它在哪里定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在浏览gcc编译器的源代码,并且在fork.c中也遇到了这一点:

So I'm looking through the source of gcc compiler and I've come along this in fork.c:

int
__fork ()
{
  __set_errno (ENOSYS);
  return -1;
}
libc_hidden_def (__fork)
stub_warning (fork)

weak_alias (__fork, fork)
#include <stub-tag.h>

我正试图弄清weak_alias的作用.我已经在glibc源文件中使用了grep命令来查找所有#defineweak_alias出现的情况:

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:

grep -r "#define weak_alias"

我发现了很多次出现的宏:

I've found many occurrences of the macro:

#define weak_alias(n, a)

,但是宏实际上并没有解释任何内容.他们只是定义了该语句,没有显示如何替换它.例如,在profil.c中出现了一次:

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:

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

那么有什么想法,weak_alias做什么以及它的定义位置是什么?

So any ideas what weak_alias does and where it is being defined?

预先感谢

推荐答案

来自关于弱符号:

https://en.wikipedia.org/wiki/Weak_symbol

这篇关于weak_alias函数做什么,它在哪里定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆