static_var_uninit为未初始化全局变量和静态变量,未初始化全局变量和静态变量位于位于.bss
section,此节区不占用 ELF
文件空间,但占用程序的内存映像中的空间。当程序开始执行时,系统将把这些数据初始化为
0。bss 其实是 block started by symbol 的简写.
使用指令
1
objdump -t hello.o
查看符号表,输出如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0000000000000000 l df *ABS* 0000000000000000 hello.c 0000000000000000 l d .text 0000000000000000 .text 0000000000000000 l d .bss 0000000000000000 .bss 0000000000000000 l d .rodata 0000000000000000 .rodata 0000000000000000 l O .bss 0000000000000004 static_var_uninit.1 0000000000000004 l O .data 0000000000000004 static_var.0 0000000000000000 l d .debug_info 0000000000000000 .debug_info 0000000000000000 l d .debug_abbrev 0000000000000000 .debug_abbrev 0000000000000000 l d .debug_line 0000000000000000 .debug_line 0000000000000000 l d .debug_str 0000000000000000 .debug_str 0000000000000000 l d .debug_line_str 0000000000000000 .debug_line_str 0000000000000000 g O .data 0000000000000004 global_init 0000000000000000 g O .rodata 0000000000000004 global_const 0000000000000000 g F .text 0000000000000025 main 0000000000000000 *UND* 0000000000000000 puts