“Local Linker Symbols”和“Local Linker Symbols”有什么区别? “本地程序变量”?

时间:2010-03-03 22:19:37

标签: linker symbols elf

我想知道“本地链接符号”和“本地链接符号”之间的区别。 “本地程序变量”?

我正在读一本有这本书的书:

alt text http://img682.imageshack.us/img682/9816/symbols.jpg

每个人的意思是什么?有什么例子吗?

2 个答案:

答案 0 :(得分:3)

/* This function has global scope within this file (module). It is represented 
 * by a "local linker symbol", since the linker will need to resolve its address 
 * if it is referenced by any other function.
 */
static void some_function()
{
    /* These "local program variables" are of no interest to the linker 
     * since they are not visible outside the current function, so no other 
     * part of the program can possibly reference them.
     */
    int a, b, c;
}

答案 1 :(得分:0)

本地链接器符号由模块专门定义和引用。

基本上,静态变量和函数是链接器符号,这些变量或函数对于除自身之外的其他模块是不可见的,这些变量和函数作为可重定位目标模块中的本地符号包含在符号表中。

局部变量是本地定义的变量,这意味着它们不是全局变量。