Rtld: Difference between revisions
Add some links |
m Fix link to MOD page |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
rtld, short for “runtime link-editor”, is the first executable code belonging to the program that the system launches. This serves as the program entry point and crt0. rtld's entry point is defined to be the start of its .text section. | rtld, short for “runtime link-editor”, is the first executable code belonging to the program that the system launches. This serves as the program entry point and crt0. rtld's entry point is defined to be the start of its .text section. | ||
rtld is tasked with relocating the [[NSO|NSOs]] that were loaded in to memory by the system loader, at a random base address. To do this, it requires that binaries include a [[ | rtld is tasked with relocating the [[NSO|NSOs]] that were loaded in to memory by the system loader, at a random base address. To do this, it requires that binaries include a [[MOD|module header]], and a pointer to it at offset +0x04 in the .text section. | ||
rtld receives two parameters from the system, in X0 and X1. The first parameter should be null. The second parameter is the handle of the main thread. See the [[Homebrew_ABI#Entrypoint_Arguments|entrypoint arguments]] section. | rtld receives two parameters from the system, in X0 and X1. The first parameter should be null. The second parameter is the handle of the main thread. See the [[Homebrew_ABI#Entrypoint_Arguments|entrypoint arguments]] section. | ||
| Line 44: | Line 44: | ||
|- | |- | ||
| 257 || R_AARCH64_ABS64 | | 257 || R_AARCH64_ABS64 | ||
|- | |||
| 258 || R_AARCH64_ABS32 | |||
|- | |- | ||
| 1025 || R_AARCH64_GLOB_DAT | | 1025 || R_AARCH64_GLOB_DAT | ||