Line 1: |
Line 1: |
| == Summary == | | == Summary == |
| | | |
− | There are two moments of time when criu runs in somewhat strange environment | + | There are two moments in time where criu runs in a somewhat strange environment |
| | | |
| * [[Parasite code]] execution | | * [[Parasite code]] execution |
Line 8: |
Line 8: |
| == Building PIE code blobs for criu == | | == Building PIE code blobs for criu == |
| | | |
− | Parasite code executes in dumpee process context thus it needs to be [http://en.wikipedia.org/wiki/Position-independent_code PIE] | + | Parasite code executes in the dumpee process context thus it needs to be [http://en.wikipedia.org/wiki/Position-independent_code PIE] |
| compiled and to have own stack. The same applies to restorer code, which takes place at the very end of restore procedure. | | compiled and to have own stack. The same applies to restorer code, which takes place at the very end of restore procedure. |
| | | |
− | Thus we need to reserve stack place statically somewhere in criu and use it at dump/checkpoint stages. To achieve | + | Thus we need to reserve stack, place it statically somewhere in criu and use it at dump/checkpoint stages. To achieve |
− | this (and still have some human way to edit source code) we do the following tricks | + | this (and still have some human way to edit source code) we use the following tricks |
| | | |
− | * Parasite code has own bootstrap code laid in pure assembler file (parasite_head.S) | + | * Parasite code has own bootstrap code laid in a pure assembler file (parasite_head.S) |
− | * Restorer bootstrap code is done a bit simplier in restorer.c file. | + | * Restorer bootstrap code is done in a simpler way in restorer.c. |
| | | |
− | For both cases we generate headers files which consist of | + | For both cases we generate header files which consist of |
| | | |
| * Functions offsets for export | | * Functions offsets for export |
Line 35: |
Line 35: |
| }; | | }; |
| | | |
− | These headers we include in criu compiled file and then use for checkpoint/restore. | + | These headers we include in the criu compiled file and then use them for checkpoint/restore. |
| | | |
− | Generation of this files is done in several steps | + | Generation of these files is done in several steps |
| | | |
| * All object files needed by are linked into 'built-in.o' | | * All object files needed by are linked into 'built-in.o' |