“输入"是什么意思?在链接描述文件中是什么意思? [英] What does "ENTRY" mean in a linker script?

查看:152
本文介绍了“输入"是什么意思?在链接描述文件中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习为微控制器编写一些底层软件,并且已经开始研究链接描述文件.

I am beginning to learn to write some low-level software for micro-controllers, and I've started studying linker scripts.

在这种情况下,我并没有真正了解ENTRY命令的含义.由于大多数微控制器从预定地址开始执行,所以在链接描述文件中选择哪个入口点有什么区别?

I don't really get the meaning of the ENTRY command in this context. Since most micro-controllers start execution at a predetermined address, what difference does it make which entry point we choose in the linker script?

推荐答案

ENTRY()是一种ELF功能,它基本上只是在可执行文件的ELF标头中设置程序入口地址.此地址可能与二进制文件的第一个可执行段的起始地址不同(如果未定义ENTRY(),则它将是默认执行地址).

ENTRY() is an ELF feature that basically just sets the program entry address in the ELF header of your executable. This address may differ from the start address of the first executable segment of your binary (which would be the default execution address if you didn't define ENTRY()).

是否使用此信息(例如,执行开始是在第一个代码段地址还是在ENTRY()处进行)都不受链接器的控制,因为它完全取决于ELF加载程序的可用性和功能.

Whether this information is used (i.e. whether start of execution happens at the first code segment address or at ENTRY()) is out of control of the linker as it entirely depends on the availability and features of your ELF loader.

由于您通常在微控制器上没有这种东西,所以ENTRY()在那儿实际上是无用的,您也可以不加任何考虑而忽略该语句.

As you usually do not have such thing on a microcontroller, ENTRY() is practically useless there and you might as well omit the statement at no consequence.

这篇关于“输入"是什么意思?在链接描述文件中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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