文本,数据和bss [英] text,data and bss

查看:69
本文介绍了文本,数据和bss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚才知道有三个不同的部分我们可以

除以我们的程序

*文字部分

*数据部分

* Bss


i认为文本部分包含我们的代码,数据部分包括堆,堆栈

(?)等。 />

任何人都可以点亮Bss部分...

i just got to know there are three different sections in which we can
divide our program
*Text section
*Data section
*Bss

i think text section contain our code,data section include heap,stack
(?) etc.

Can any body throw light on Bss section...

推荐答案

c。*********** @ gmail.com 写道:

i刚才知道有三个不同的部分我们可以

除以我们的程序

*文字部分

*数据部分

* Bss


i认为文本部分包含我们的代码,数据部分包括堆,堆栈

(?)等。


任何身体都可以点亮Bss部分...
i just got to know there are three different sections in which we can
divide our program
*Text section
*Data section
*Bss

i think text section contain our code,data section include heap,stack
(?) etc.

Can any body throw light on Bss section...

http://en.wikipedia.org/wiki/.bss


再见,Jojo

http://en.wikipedia.org/wiki/.bss

Bye, Jojo


2008年11月16日12:14, c。*********** @ gmail.com 写道:
On 16 Nov 2008 at 12:14, c.***********@gmail.com wrote:

i刚才知道有我们可以分三个不同的部分

划分我们的计划

*文字部分

*数据部分

* Bss


i认为文本部分包含我们的代码,数据部分包括堆,堆栈

(?)等等。
i just got to know there are three different sections in which we can
divide our program
*Text section
*Data section
*Bss

i think text section contain our code,data section include heap,stack
(?) etc.



堆和堆栈占用文本

和数据段上方的虚拟内存位置。堆将向上增长,堆栈向下从最高内存地址




这是一张图片:


最高地址

=========

|堆栈|

| vv |

| |

| |

| ^^ |

|堆|

=========

| bss |

=========

|数据|

=========

|文字|

=========

地址0

The heap and stack occupy the virtual memory locations above the text
and data segments. The heap will grow upwards, the stack downwards from
the highest memory address.

Here is a picture:

highest address
=========
| stack |
| vv |
| |
| |
| ^^ |
| heap |
=========
| bss |
=========
| data |
=========
| text |
=========
address 0


任何身体都可以投光在Bss部分...
Can any body throw light on Bss section...



初始化为0的变量放在BSS段中。

静态变量未初始化为0,常量,字符串等是

放在数据段中。

Variables that are initialized to 0 are placed in the BSS segment.
Static variables not initialized to 0, constants, strings, etc. are
placed in the data segment.




< c.***********@gmail.com在留言中写道

新闻:5c ******************** ************** @ o40g2000 prn.googlegroups.com ...

<c.***********@gmail.comwrote in message
news:5c**********************************@o40g2000 prn.googlegroups.com...

>我刚才知道有三个我们可以在不同的部分

划分我们的程序

*文本部分
>i just got to know there are three different sections in which we can
divide our program
*Text section



可执行代码

Executable code


*数据部分
*Data section



在编译时初始化的静态数据(变量等)。这两个都在可执行文件中使用了

空格。

Static data (variables etc) initialised at compile time. Both of these use
up space in the executable.


* Bss
*Bss



静态数据(变量等)在编译时未初始化(或者可能,

初始化为零)。这些不占用可执行文件中的数据空间。在运行时

你希望这些初始化为零。

Static data (variables etc) uninitialised at compile time (or possibly,
initialised to zero). These take no data space in the executable. At runtime
you would hope these are initialised to zero.


i think text section包含我们的代码,数据部分包含堆,stack

(?)等。
i think text section contain our code,data section include heap,stack
(?) etc.



堆和堆栈是在运行时分配的。它们在

可执行文件中占用的空间虽然可以指定它们的大小,特别是

堆栈。


这都是在典型的C实现的上下文中使用传统的编译和链接以及可执行文件的概念。

理论上C可以完全不同地实现。或者甚至稍微有点

不同......


-

Bartc

Heap and stack are assigned at runtime. They take up no space in the
executable although it may specify what size they should be, especially the
stack.

This is all in the context of a typical C implementation that uses
traditional compilation and linking and the concept of an executable file.
In theory C could be implemented entirely differently. Or even slightly
differently...

--
Bartc


这篇关于文本,数据和bss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆