let's say I have a source file
dll.c that use
dlsym functions to load a shared library called
F.so in run time.
dll.c has a reference to
F.so has the definition of
and let's say the picture below is the executable object
prog which is obtained by
linux> gcc -rdynamic -o prog dll.c -ldl
.text section contains the reference of
some_function() that needs to be resolved when the porgram load
F.so and start to call
My questions are:
It seems to me that the
some_function()belongs to) in RAM(executable is copied into memory) needs to be modified by the dynamic linker so that the reference of
some_function()can be resolved, is my understanding correct?
If the dynamic linker needs to modify the
.textsection in RAM, how does it do it? from my understanding,
.textsection is read-only segment in RAM, how can a read-only segment be modified if it is called read-only?