Load-time relocation and ASLR
Posted: Mon Sep 15, 2014 10:49 am
I've a confusion regarding load-time relocation, suppose there are two different shared libraries (having no common symbols) viz. "a.so" and "b.so",compiled with -shared option(no -fpic) and
some code "x" is linked with library "a.so" and other independent code "y" is linked with both the libraries.
After loading these codes, common library "a.so" was loaded at different address ??
Clearly dynamic linker/loader has to perform relocation two times resulting in extra computing and moreover library was consuming space in both the process. Doesn't that defeat the whole purpose of the shared libraries ??
Is ASLR the reason behind this ??
So with load-time libraries what have we gained (apart from saved disk space)???
One more question if above assumption is correct then why windows dll (32bit) is not using pic??
Can someone drag me to epiphany??
some code "x" is linked with library "a.so" and other independent code "y" is linked with both the libraries.
After loading these codes, common library "a.so" was loaded at different address ??
Clearly dynamic linker/loader has to perform relocation two times resulting in extra computing and moreover library was consuming space in both the process. Doesn't that defeat the whole purpose of the shared libraries ??
Is ASLR the reason behind this ??
So with load-time libraries what have we gained (apart from saved disk space)???
One more question if above assumption is correct then why windows dll (32bit) is not using pic??
Can someone drag me to epiphany??