|
|
|
|
|
 Re: 关于加载器的问题 - qiyoa [ 2006-08-31 22:12 | 380 byte(s)]
 Re: 关于加载器的问题 - grip2 [ 2006-09-01 11:10 | 223 byte(s)]
 Re: 关于加载器的问题 - grip2 [ 2006-09-01 10:26 | 166 byte(s)]
 Re: 关于加载器的问题 - teawater [ 2006-09-01 09:39 | 144 byte(s)]
 Re: 关于加载器的问题 - qiyoa [ 2006-09-01 21:41 | 382 byte(s)]
 Re: 关于加载器的问题 - grip2 [ 2006-09-04 10:34 | 104 byte(s)]
 Re: 关于加载器的问题 - qiyoa [ 2006-09-04 21:19 | 106 byte(s)]
 Re: 关于加载器的问题 - grip2 [ 2006-09-05 11:01 | 3 byte(s)]
 Re: 关于加载器的问题 - IN_FLAMES [ 2006-09-04 10:51 | 74 byte(s)]
 Re: 关于加载器的问题 - grip2 [ 2006-09-04 13:24 | 1,052 byte(s)]
 Re: 关于加载器的问题 - 1help1 [ 2006-09-01 12:27 | 132 byte(s)]
 Re: 关于加载器的问题 - shy828301 [ 2006-09-01 13:08 | 98 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
|
加载器到底是什么?在哪儿?是操作系统的一段代码吗?如果是的话,那没有操作系统的情况下,比如bootloader,那程序岂不是不能被加载?那在程序里定义的链接地址不是失去意义了么?
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
windows中的加载器可能在操作系统中;linux中的加载器在OS外部。
加载器就是把可执行程序加载到某个地址,并且做一些符号解析和重定向的工作。
没有操作系统,就必须利用别的程序加载。比如可以通过jtag,把image加载到目标的某个地址,然后让pc指向那个地址。(当然,前提是那段ram已经初始化了)。
linker & Loader已经有中文版了,不如去看看!
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
Internally the Linux kernel uses a binary format loader layer to
implement the low level format dependend functionality of the execve()
system call.
|
|
----
一起在命令行上跳舞?
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
>> linux中的加载器在OS外部
你的OS是指内核?即使这样也不正确,LINUX中的loader是在kernel中实现,即使是通过模块register也同样属于内核范围(完全在用户层的loader在现有架构下很难想象)。
|
|
|
----
一起在命令行上跳舞?
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
|
类似于DOS那样的操作系统的loadr需要对程序进行重定位,Linux和Windows的就不需要了,完全是linker来做了
|
|
----
我的blog:http://hi.baidu.com/juventus
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
在内核外部。我认为,:)
最起码动态加载器在内核外部!(如果不对,请指教)
可执行程序本身是由kernel,fork,exec等系统调用,把可执行程序加载进来。
但是这些只是一个helloword可以运行的n多步中的一步,下来的工作应该是加载器加载相应的动态库。
符号解析和重定向的工作,连接器和加载器谁做都可以。
刚从linker & Loader上看到的!
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
见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签名的一个变种 ;-)
|
|
|
----
一起在命令行上跳舞?
|
|
[Original]
[Print]
[Top]
|
|
|