【问题标题】:What is the difference between "Local Linker Symbols" & "Local Program Variables"?“本地链接器符号”和“本地程序变量”有什么区别?
【发布时间】:2010-03-03 22:19:36
【问题描述】:

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

我正在读一本这样的书:

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

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

【问题讨论】:

    标签: linker symbols elf


    【解决方案1】:
    /* 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;
    }
    

    【讨论】:

      【解决方案2】:

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

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-09-16
        • 2010-10-11
        • 2016-05-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-02-25
        相关资源
        最近更新 更多