Answer the question
In order to leave comments, you need to log in
Is it possible to relocate process data/stack?
Do I understand correctly that we cannot (in the general case) correctly relocate (move by some offset) the process data/stack? I mean x86_64/AArch64 code generated by a regular compiler. Please do not confuse with code relocation (PIC).
Answer the question
In order to leave comments, you need to log in
Depending on what is meant by "move". Before execution starts, the stack can be placed anywhere. Because addressing on the stack is always relative to the stack pointer/frame pointer. During operation, the stack pointer can be moved down to an arbitrary depth. The used part of the stack cannot be transferred during operation. In general, data cannot be transferred. To be able to, you need to use the base register and refer to offsets from it. For example, this is how TLS and FDPIC work. On the other hand, code generated as PIC/PIE can be moved along with the data, and if you analyze the fixups and apply only those that refer to the data segment, the data can be moved separately from the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question