gpt4 book ai didi

c - 如何理解glibc交叉引用?

转载 作者:太空宇宙 更新时间:2023-11-04 00:03:25 36 4
gpt4 key购买 nike

我想了解 hello world 程序是如何工作的:

#include <stdio.h>

int main(int argc, char **argv) {
printf("Hello World!");
return 0;
}

printf 部分外,大部分内容都很简单。我不知道它是如何工作的。为了理解它,我找了glibc cross reference并找到this page .

然后我搜索了 printf,它返回了很多 results .

现在我的程序正在使用这些 printf 中的哪一个?我怎样才能确定它?

另外,例如当打开 first result在该页面中,printf 函数中的函数将我引导至 __printf_chk ,其中 __printf_chk 中的函数将我引向 __nldbl___vfprintf_chk ,其中 __nldbl___vfprintf_chk 中的函数将我引向 __vfprintf_chk ,其中 __vfprintf_chk 中的函数将我再次引导至 __nldbl___vfprintf_chk ,它创建了一个无限递归。怎么回事?

简而言之,我应该如何跟踪给定函数/源代码的来源?

最佳答案

我没有完整的答案,但我无法发表评论。看起来 __vfprintf_chk 调用了 vfprintf,它似乎是/stdio-common/vfprintf.c 中的 _IO_vfprintf_internal 的别名。不知道最后一个函数的由来,但是我在这里看不到死循环?

关于c - 如何理解glibc交叉引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33780167/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com