symbol table local static variable name

c, compilation, symbols

Solution

There can be many local static variables with the same name (across different functions). The compiler is giving them disambiguating suffixes to avoid a potential name collision.

Problem

Why is there a number added to the name of a local static variable in the symbol table? ``` int main(void) { static stat_var = 20; return 0; } ``` 8: 0000000000000008 4 OBJECT LOCAL DEFAULT 2 stat_var.1604

Original source