shared library loading
Posted: Tue Aug 26, 2014 3:41 am
hi, guys!
i wanna add elf shared library support to my os. but i found it is really a tough work.
as far as i can know,in kernel space, i should load a .so file called interpreter(in linux, it is ld-linux.so.2) first if i want to load a dynamic linked app. and the problem is:
1,in kernel space, i should build a auxiliary vector that is used by interpreter on app's stack and then call the interpreter's entry point. i wanna know how to build this vector,and what is needed i should supply to interpreter?
i do a little homework looking up linux kernel source code, the create_elf_tables() does these stuff, but it is hard to comprehension. hope someone can give me more details. Spec is also ok.
2,for the interpreter, do i must implement it by my self? can i port some existing ones? glibc contains a shared library loader, uclibc also does, but they all for linux platform, and it's hard to porting. any one has good ideas?
thanks.
i wanna add elf shared library support to my os. but i found it is really a tough work.
as far as i can know,in kernel space, i should load a .so file called interpreter(in linux, it is ld-linux.so.2) first if i want to load a dynamic linked app. and the problem is:
1,in kernel space, i should build a auxiliary vector that is used by interpreter on app's stack and then call the interpreter's entry point. i wanna know how to build this vector,and what is needed i should supply to interpreter?
i do a little homework looking up linux kernel source code, the create_elf_tables() does these stuff, but it is hard to comprehension. hope someone can give me more details. Spec is also ok.
2,for the interpreter, do i must implement it by my self? can i port some existing ones? glibc contains a shared library loader, uclibc also does, but they all for linux platform, and it's hard to porting. any one has good ideas?
thanks.