哪里有符号ETEXT中,edata和结束界定? [英] Where are the symbols etext ,edata and end defined?

查看:532
本文介绍了哪里有符号ETEXT中,edata和结束界定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是从Linux手册页code:

This is a code from Linux man page:

#include <stdio.h>
#include <stdlib.h>

extern char etext, edata, end;

int main() {
    printf("First address past:\n");
    printf("    program text (etext)      %10p\n", &etext);
    printf("    initialized data (edata)  %10p\n", &edata);
    printf("    uninitialized data (end)  %10p\n", &end);

    exit(EXIT_SUCCESS);
}

在运行时,下面的程序产生的输出,如以下内容:

when run, the program below produces output such as the following:

$ ./a.out
First address past:
    program text (etext)       0x8048568
    initialized data (edata)   0x804a01c
    uninitialized data (end)   0x804a024

在哪里 ETEXT EDATA 结束定义?这些符号是如何分配的值?它是通过连接器或其他什么东西?

Where are etext, edata end defined ? How those symbols are assigned values ? Is it by linker or something else ?

推荐答案

这些符号在<定义href=\"https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/scripts.html\"相对=nofollow>链接脚本文件。

这篇关于哪里有符号ETEXT中,edata和结束界定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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