2 ms·
Exist a distilled example of this? I'm totally lost in how make compiled/static code to work as dynamic.
by mamcx 12y ago
Exist a distilled example of this? I'm totally lost in how make compiled/static code to work as dynamic.
- jey 12y agoThe word "dynamic" in the grandparent post refers to dynamically relocatable object files, i.e. all the memory references in the binary are written as relative offsets so that the binary doesn't assume anything about what address it will have within the process when it gets loaded. Concretely, this means the difference between "JMP 0xDEADBEEF" versus "JMP (special_register)+0xBEEF" so that the .so or .dll file doesn't assume it'll get loaded at 0xDEAD0000. For a less confusing explanation, see https://en.wikipedia.org/wiki/Position-independent_code https://en.wikipedia.org/wiki/Position-independent_code (Also: no, it's not really implemented by using one offset register for each .so file in the process.)