- 论坛徽章:
- 0
|
程序:
1 #include<stdio.h>
2 int a;
3 int b=3;
4 int main()
5 {
6 static int c=4;
7 static int d;
8 int e,f;
9 int g=5;
10 printf("%d,%d,%d,%d,%d,%d\n",a,b,c,d,e,f,g);
11
12 }
符号表
[root@localhost file]# readelf -s com.o
Symbol table '.symtab' contains 14 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 FILE LOCAL DEFAULT ABS com.c
2: 00000000 0 SECTION LOCAL DEFAULT 1
3: 00000000 0 SECTION LOCAL DEFAULT 3
4: 00000000 0 SECTION LOCAL DEFAULT 4
5: 00000000 4 OBJECT LOCAL DEFAULT 4 d.1572
6: 00000004 4 OBJECT LOCAL DEFAULT 3 c.1571
7: 00000000 0 SECTION LOCAL DEFAULT 5
8: 00000000 0 SECTION LOCAL DEFAULT 7
9: 00000000 0 SECTION LOCAL DEFAULT 6
10: 00000000 4 OBJECT GLOBAL DEFAULT 3 b
11: 00000000 110 FUNC GLOBAL DEFAULT 1 main
12: 00000004 4 OBJECT GLOBAL DEFAULT COM a
13: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf
在里面找不到e,f的信息
[ 本帖最后由 xdshting 于 2009-12-8 15:35 编辑 ] |
|