> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/misc/end.3.md).

# end.3

`end` — 镜像段的结束边界

## 名称

`end`, `etext`, `edata`

## 概要

```c
extern end;
extern etext;
extern edata;
```

## 描述

全局变量 `end`、`etext` 和 `edata` 是程序段的结束地址。

`etext` 是文本段结束后的第一个地址。

`edata` 是已初始化数据段结束后的第一个地址。

`end` 是程序加载时数据段（BSS）结束后的第一个地址。使用 sbrk(2) 系统调用并以零作为参数，可找到数据段的当前末尾。

## 参见

sbrk(2), malloc(3), [a.out(5)](/man/man5/a.out.5.md)

## 历史

`edata` 手册页出现于 Version 6 AT\&T UNIX。

## 缺陷

按惯例，不存在指向文本段起始位置的变量，因为文本段总是从地址零开始。尽管这一假设已不再成立，但并不存在与上述文档类似的指向文本段起始位置的变量。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/misc/end.3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
