Re:Making a RISC-V Operating System Using Rust
by dzaima on Wednesday June 14, 2023 @05:09AM
(#36323348)
Direct function calls are usually done relative to the program counter (pc in auipc). So you get 32 bits of displacement, which is fine as long as your code is less than 4GB, and you get position-independent code for free. This is the same as on x86-64 and aarch64 too, which also have ~32 bits for call target immediates. (also, compilers have "code model" options for choosing the size of code to support)
[ Parent
| on HN ]
Re:Making a RISC-V Operating System Using Rust
by MSFT_Edging on Wednesday June 14, 2023 @09:05AM
(#36325282)
I assume there's also support for a kind of calculated long jump done at elf load time? I know that's done as part of the relocations on aarch64.