4

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

我正在读一本书,里面有这个:

替代文字 http://img682.imageshack.us/img682/9816/symbols.jpg

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

4

2 回答 2

4
/* 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;
}
于 2010-03-03T22:49:17.147 回答
1

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

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

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

于 2015-05-14T04:19:49.950 回答