.SO Dynamic Linking
.SO Dynamic Linking
How can I use dynamic linking with .SO libraries and ELF binaries?
Well, do you mean for linking applications at run time for your OS?
I haven't gotten that far by a long shot, but for ELF I'm pretty sure it goes something along the lines of this:
I believe that the ELF headers contain a list of functions that are exported from the dynamic library, then the application that requires the library has information in its header that lists the functions required. You would then load the required dynamic library into memory and "link" it together by copying the address of the exported functions into their required locations in the application.
For the specifcs, I'm afraid you're going to have to look up the ELF specification, it's going to tell you all of the details. Even then, it's going to depend on your OS.
On the other hand, if you're talking about using dynamic libraries in your kernel and you want to know how to do something like pass this information to the linker utility, then I have no clue. Generally I guess that would require the above functionality for the kernel anyway.
I haven't gotten that far by a long shot, but for ELF I'm pretty sure it goes something along the lines of this:
I believe that the ELF headers contain a list of functions that are exported from the dynamic library, then the application that requires the library has information in its header that lists the functions required. You would then load the required dynamic library into memory and "link" it together by copying the address of the exported functions into their required locations in the application.
For the specifcs, I'm afraid you're going to have to look up the ELF specification, it's going to tell you all of the details. Even then, it's going to depend on your OS.
On the other hand, if you're talking about using dynamic libraries in your kernel and you want to know how to do something like pass this information to the linker utility, then I have no clue. Generally I guess that would require the above functionality for the kernel anyway.
I need to know the second thingTelgin wrote:Well, do you mean for linking applications at run time for your OS?
I haven't gotten that far by a long shot, but for ELF I'm pretty sure it goes something along the lines of this:
I believe that the ELF headers contain a list of functions that are exported from the dynamic library, then the application that requires the library has information in its header that lists the functions required. You would then load the required dynamic library into memory and "link" it together by copying the address of the exported functions into their required locations in the application.
For the specifcs, I'm afraid you're going to have to look up the ELF specification, it's going to tell you all of the details. Even then, it's going to depend on your OS.
On the other hand, if you're talking about using dynamic libraries in your kernel and you want to know how to do something like pass this information to the linker utility, then I have no clue. Generally I guess that would require the above functionality for the kernel anyway.