Skip to content

Commit 589d071

Browse files
committed
[lldb][RISCV] PIC for RISCV64 MCJIT
Function calls support in LLDB expressions for RISCV: 3 of 6 This patch allows to access .rodata section from lldb expressions (like string literals).
1 parent fb8a9d0 commit 589d071

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lldb/source/Expression/IRExecutionUnit.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
274274

275275
builder.setEngineKind(llvm::EngineKind::JIT)
276276
.setErrorStr(&error_string)
277-
.setRelocationModel(triple.isOSBinFormatMachO() ? llvm::Reloc::PIC_
278-
: llvm::Reloc::Static)
277+
.setRelocationModel((triple.isOSBinFormatMachO() || triple.isRISCV64())
278+
? llvm::Reloc::PIC_
279+
: llvm::Reloc::Static)
279280
.setMCJITMemoryManager(std::make_unique<MemoryManager>(*this))
280281
.setOptLevel(llvm::CodeGenOptLevel::Less);
281282

0 commit comments

Comments
 (0)