关于加载器的问题

来源:互联网 发布:c语言百马百担问题 编辑:程序博客网 时间:2024/05/22 11:55

windows中的加载器可能在操作系统中;linux中的加载器在OS外部。

加载器就是把可执行程序加载到某个地址,并且做一些符号解析和重定向的工作。

没有操作系统,就必须利用别的程序加载。比如可以通过jtag,把image加载到目标的某个地址,然后让pc指向那个地址。(当然,前提是那段ram已经初始化了)。

linker & Loader已经有中文版了,不如去看看!

 

 

见ELF规范文档:

Program Interpreter

An executable file may have one PT_INTERP program header element.
During exec(BA_OS), the system retrieves a path name from the
PT_INTERP segment and creates the initial process image from the
interpreter file's segments. That is, instead of using the original
executable file's segment images, the system composes a memory image
for the interpreter. It then is the interpreter's responsibility to
receive control from the system and provide an environment for the
application program.

...

Dynamic Linker

When building an executable file that uses dynamic linking, the link
editor adds a program header element of type PT_INTERP to an
executable file, telling the system to invoke the dynamic linker as
the program interpreter.

...

BTW: 不认识rebuilder,这个应该算是rebuilder签名的一个变种 ;-)

http://www.unixresources.net/linux/clf/cpu/archive/00/00/62/31/623154.html