程序的加载与链接(二) 数据段
2019-11-01 本文已影响0人
狼性刀锋
这次的helloworld 加个字符串
int main(int argc, const char * argv[]) {
char hello_str[] = "helloWorld!";
return 0;
}
同样的使用MachOView透视一下
![](https://img.haomeiwen.com/i2031664/638c9b77ec8e715e.png)
![](https://img.haomeiwen.com/i2031664/6a1282cb32f76977.png)
这个时候多了一个Section和与其对应的Section Header对应的就是数据段,准确的说是常量区,现在整个执行文件加载之后就是这个样子
- 不可访问区
- 代码区
- 常量区