This patch add the R_RISCV_GOT_HI20 and R_RISCV_CALL_PLT relocation support. And the basic got/plt was implemented. Because of riscv32 and riscv64 has different pointer size, the got entry size and instructions of plt entry is different. This patch is the basic support, the optimization pass at preFixup stage has not been implemented.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
As usual I can't speak to the RISCV specifics, but the patch looks good to me in general.
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp | ||
---|---|---|
83 | These look like Mach-O-isms, where sections are generally called __FOO. The ELF names for sections is normally .foo; e.g. the GOT is normally in a .got section. This does not make sense as an ELF section name. Assuming "stubs" here means PLT, it should be in a .plt section. |
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp | ||
---|---|---|
83 | For now we're sticking to consistent names for synthetic sections, unless there's a concrete need to stick to format specifics -- this helps keep utility passes as simple as possible. if ELF .got/.plt sections are referred to by name from other parts of the object that would be a good reason to change the names here, but I don't think that's supported? |
These look like Mach-O-isms, where sections are generally called __FOO. The ELF names for sections is normally .foo; e.g. the GOT is normally in a .got section. This does not make sense as an ELF section name. Assuming "stubs" here means PLT, it should be in a .plt section.