diff options
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index d79ff97dc..07b9086f9 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | // gta6rt: native runtime for the Xbox Series build. | 1 | // gta6rt: native runtime for the Xbox Series build. |
| 2 | // | 2 | // |
| 3 | // gta6rt --dry-run <image> [--game-dir DIR] | 3 | // gta6rt --dry-run <image> [--game-dir DIR] |
| 4 | // Maps the image and its bundled modules, applies relocations, binds every import and prints a report. | 4 | // Maps the image and its bundled modules, applies relocations, binds every import, installs static TLS for |
| 5 | // No code from the image runs. | 5 | // this thread and prints a report. No code from the mapped images |
| 6 | // runs. TLS needs the runtime's own gta6rt_tls_host.dll, which reserves the module TLS index; system DLLs are | ||
| 7 | // loaded to resolve host imports, as before. | ||
| 6 | // | 8 | // |
| 7 | // gta6rt --init <image> [--game-dir DIR] | 9 | // gta6rt --init <image> [--game-dir DIR] |
| 8 | // The same mapping, then each loaded DLL's TLS callbacks and DllMain(DLL_PROCESS_ATTACH) are run. | 10 | // The same mapping, then each loaded DLL's TLS callbacks and DllMain(DLL_PROCESS_ATTACH) are run. |
| @@ -66,9 +68,9 @@ int wmain(int argc, wchar_t** argv) { | |||
| 66 | 68 | ||
| 67 | try { | 69 | try { |
| 68 | rt::Loader loader(game_dir); | 70 | rt::Loader loader(game_dir); |
| 69 | rt::Module& main_module = loader.load(image); | 71 | rt::Module& main_module = loader.load(image); // maps, binds and installs TLS; runs no image code |
| 70 | if (init || run) { | 72 | if (init || run) { |
| 71 | loader.initialise(); | 73 | loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs |
| 72 | std::printf("%zu module(s) initialised\n", loader.modules().size()); | 74 | std::printf("%zu module(s) initialised\n", loader.modules().size()); |
| 73 | } | 75 | } |
| 74 | int unimplemented = 0; | 76 | int unimplemented = 0; |