静态重定位或段的静态重定位是什么意思
elf 格式的可执行文件包含各种段,如代码、数据、bss、堆栈等。 如果我们说段 xyz 是静态重定位的,那意味着什么?
elf 格式的二进制文件包含每个段的相对地址。当我们说静态重定位时,是否意味着相对地址实际上是物理地址?
The elf format executable contains various segments like code, data, bss, stack etc.
If we say that the segment xyz is statically relocated what does that mean?
The elf format binary contains relative addresses for each segment. When we say statically relocated does it mean that the relative addresses are actually the physical addresses?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
静态重定位意味着在程序运行之前移动数据或编码并为其分配绝对位置。
例如:链接器是静态重定位的一个例子,它移动程序的多个模块并将它们组合成程序。
Static relocation means moving data or coding and assigning absolute locations to them before a program is run.
For ex:- Linker is an example of static relocation which moves several modules of the program and combine them into program.
静态重定位是指在程序开始执行之前完成的地址转换。典型的硬件指令周期如下所示:
Static relocation refers to address transformations being done before execution of a program begins. A typical hardware instruction cycle looks like this:
在没有内存抽象的情况下(程序直接访问物理内存)
事情是这样的:
程序A使用地址x
程序 B 也在某些时候使用地址 x
以便两个程序同时运行某些操作系统/早期计算机(例如 IBM 360)会在加载程序 B 时动态修改其地址,以便它不会使用程序使用的内存地址一个
in a no memory abstraction situation ( programs access physical memory directly )
it goes like this:
program A uses address x
program B also uses address x at some point
in order for both programs to run simultaneously some operating systems / early computers such as the IBM 360 modifies program B's addresses on the fly as it loaded it, so that it wont use memory adresses used by program A