操作系统学习笔记(18)--bss段设置

来源:互联网 发布:gif截图软件 编辑:程序博客网 时间:2024/06/01 07:41

 

bss段需要填充为0

 

 

 

[root@localhost testc]#gcc bbs.c

[root@localhost testc]# ./a.out
bss start 8049704
bss end  804970c
bss start 0
bss end  0
len 8
char 0char 0char 0char 0char 0char 0char 0char 0

 

下面是别人的解释参考一下:__bss_start isn't a pointer, nor does it hold anything. It's just a number generated by the linker that states where the bss starts. i.e. __bss_start does not occupy any memory space, it is a label. You could just as easily declare it as a short or a char.