Skip to content

Commit

Permalink
[lldb][RISCV] PIC for RISCV64 MCJIT
Browse files Browse the repository at this point in the history
Function calls support in LLDB expressions for RISCV: 3 of 6

This patch allows to access .rodata section from lldb expressions (like
string literals).
  • Loading branch information
dlav-sc committed Aug 29, 2024
1 parent bd8f17d commit ee88a87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lldb/source/Expression/IRExecutionUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,

builder.setEngineKind(llvm::EngineKind::JIT)
.setErrorStr(&error_string)
.setRelocationModel(triple.isOSBinFormatMachO() ? llvm::Reloc::PIC_
: llvm::Reloc::Static)
.setRelocationModel((triple.isOSBinFormatMachO() || triple.isRISCV64())
? llvm::Reloc::PIC_
: llvm::Reloc::Static)
.setMCJITMemoryManager(std::make_unique<MemoryManager>(*this))
.setOptLevel(llvm::CodeGenOptLevel::Less);

Expand Down

0 comments on commit ee88a87

Please sign in to comment.