summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2024-08-16 09:52:36 +1000
committerGitHub <noreply@github.com>2024-08-16 09:52:36 +1000
commit3e1d4ec671c59204e3e556cc58fd948894af1e1b (patch)
treed75d72094d301ce906bd73c86da63e7ef9acb599 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h
parent039a86d057b144c963f7a30f9b4b8d3da200576d (diff)
[ORC] loadRelocatableObject: universal binary support, clearer errors (#104406)
ORC supports loading relocatable object files into a JIT'd process. The raw "add object file" API (ObjectLayer::add) accepts plain relocatable object files as llvm::MemoryBuffers only and does not check that the object file's format or architecture are compatible with the process that it will be linked in to. This API is flexible, but places the burden of error checking and universal binary support on clients. This commit introduces a new utility, loadRelocatableObject, that takes a path to load and a target triple and then: 1. If the path does not exist, returns a FileError containing the invalid path. 2. If the path points to a MachO universal binary, identifies and returns MemoryBuffer covering the slice that matches the given triple (checking that the slice really does contains a valid MachO relocatable object with a compatible arch). 3. If the path points to a regular relocatable object file, verifies that the format and architecture are compatible with the triple. Clients can use loadRelocatableObject in the common case of loading object files from disk to simplify their code. Note: Error checking for ELF and COFF is left as a FIXME. rdar://133653290
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface/ScriptedPlatformPythonInterface.h')
0 files changed, 0 insertions, 0 deletions