Skip to content

Commit ee88a87

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 bd8f17d commit ee88a87

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
@@ -281,8 +281,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
281281

282282
builder.setEngineKind(llvm::EngineKind::JIT)
283283
.setErrorStr(&error_string)
284-
.setRelocationModel(triple.isOSBinFormatMachO() ? llvm::Reloc::PIC_
285-
: llvm::Reloc::Static)
284+
.setRelocationModel((triple.isOSBinFormatMachO() || triple.isRISCV64())
285+
? llvm::Reloc::PIC_
286+
: llvm::Reloc::Static)
286287
.setMCJITMemoryManager(std::make_unique<MemoryManager>(*this))
287288
.setOptLevel(llvm::CodeGenOptLevel::Less);
288289

0 commit comments

Comments
 (0)