diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-24 20:48:32 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-24 22:10:50 +0300 |
| commit | 422b6c976e28445d2a6e14586fa416b0f16c093f (patch) | |
| tree | a6bf3364cec45ed0c5d48e346a76a98fe9d0094a /README.md | |
| download | copyjit-422b6c976e28445d2a6e14586fa416b0f16c093f.tar.gz copyjit-422b6c976e28445d2a6e14586fa416b0f16c093f.zip | |
initial commit
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..de187d6 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +Idea: try copy-and-patch, but without patching to make it 'easier' to implement. + +Essentially, build a tool that generates a bunch of operations (one per file?) +all with identical signatures, then maybe generate binary objdump of each procedure +and drop the last setup for jump (generate noop and filter all matching bytes +from other procedures?) and finally generate a header file or something with all +the function bytes. Then it should be possible to just copy them into place? + +See example what.c, which generates a noop. This noop is extracted +with `objcopy -j .text -Obinary what.o` into `what.bin` which is essentially +the 'jump to next bit' that we want to remove. + +(note that deleting the final call stuff is just opportunistic, and might not + always be possible?) +(add -fno-schedule-insns -fno-schedule-insns2 for increased chance of generating + identical epilogues) + +Additionally, it might be possible to write some data into the execution stream +with inline assembly after the jump, though that feels so hacky that I might +skip it for now... |
