search for: jitsymbolflag

Displaying 20 results from an estimated 34 matches for "jitsymbolflag".

Did you mean: jitsymbolflags
2020 Apr 13
4
LLVM 10 ORC2 issue with symbol resolution
...to &JD = *MainJD; llvm::orc::MangleAndInterner mangle(*ES, *this->DL); llvm::orc::SymbolMap Symbols; for (int i = 0; global_syms[i].name != nullptr; i++) { Symbols.insert({mangle(global_syms[i].name), llvm::JITEvaluatedSymbol(llvm::pointerToJITTargetAddress(global_syms[i].address), llvm::JITSymbolFlags(llvm::JITSymbolFlags::FlagNames::Absolute))}); } llvm::cantFail(JD.define(llvm::orc::absoluteSymbols(Symbols)), "Failed to install extern symbols"); FYI - my previous post on similar issue. Basically I haven't been able to get ORC v2 working - tried in 8, 9 and now 10. http://llvm....
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
..., *this->DL); >> llvm::orc::SymbolMap Symbols; >> for (int i = 0; global_syms[i].name != nullptr; i++) { >> Symbols.insert({mangle(global_syms[i].name), >> >> llvm::JITEvaluatedSymbol(llvm::pointerToJITTargetAddress(global_syms[i].address), >> >> llvm::JITSymbolFlags(llvm::JITSymbolFlags::FlagNames::Absolute))}); >> } >> llvm::cantFail(JD.define(llvm::orc::absoluteSymbols(Symbols)), "Failed >> to install extern symbols"); >> >> FYI - my previous post on similar issue. >> Basically I haven't been able to get ORC...
2015 Aug 13
4
Linking existing functions from JITed code
...ook up first in JIT'ed code if (auto sym = findMangledSymbol(name)) { return RuntimeDyld::SymbolInfo(sym.getAddress(), sym.getFlags()); return RuntimeDyld::SymbolInfo(nullptr); } // look up in added globals if (auto addr = getPointerToGlobalMapping(name)) { return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); } // finally try to look up existing process symbols, note // this works for symbols loaded in shared libraries, but // does NOT seem to find symbols declared in the executable. if (auto Addr = RTDyldMemoryManager::getSymbolAddressInProcess(name)) { return RuntimeDyld::SymbolInfo(Addr...
2015 Aug 13
2
Linking existing functions from JITed code
...{ >> return RuntimeDyld::SymbolInfo(sym.getAddress(), >> sym.getFlags()); >> return RuntimeDyld::SymbolInfo(nullptr); >> } >> >> // look up in added globals >> if (auto addr = getPointerToGlobalMapping(name)) { >> return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); >> } >> >> // finally try to look up existing process symbols, note >> // this works for symbols loaded in shared libraries, but >> // does NOT seem to find symbols declared in the executable. >> if (auto Addr = >> RTDyldMemoryManager::getSymbo...
2015 Aug 20
2
Linking existing functions from JITed code
...ld::SymbolInfo(sym.getAddress(), >>> sym.getFlags()); >>> return RuntimeDyld::SymbolInfo(nullptr); >>> } >>> >>> // look up in added globals >>> if (auto addr = getPointerToGlobalMapping(name)) { >>> return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); >>> } >>> >>> // finally try to look up existing process symbols, note >>> // this works for symbols loaded in shared libraries, but >>> // does NOT seem to find symbols declared in the executable. >>> if (auto Addr = >>> R...
2015 Aug 20
2
Linking existing functions from JITed code
...fo(sym.getAddress(), >>> sym.getFlags()); >>> return RuntimeDyld::SymbolInfo(nullptr); >>> } >>> >>> // look up in added globals >>> if (auto addr = getPointerToGlobalMapping(name)) { >>> return RuntimeDyld::SymbolInfo(addr, JITSymbolFlags::Exported); >>> } >>> >>> // finally try to look up existing process symbols, note >>> // this works for symbols loaded in shared libraries, but >>> // does NOT seem to find symbols declared in the executable. >>> if (auto Addr = >>...
2018 Jun 28
3
Since MCJIT I can't get libm functions to work
...m::JITSymbol(nullptr);                               },                               [](const std::string &Name) {                             if (auto SymAddr = llvm::RTDyldMemoryManager::getSymbolAddressInProcess(Name))                               return llvm::JITSymbol(SymAddr, llvm::JITSymbolFlags::Exported);                             return llvm::JITSymbol(nullptr);                               });       cantFail(CompileLayer.addModule(std::move(M),                       std::move(Resolver))); When running the program I receive the following error: LLVM ERROR: Program used extern...
2017 Sep 22
2
Question regarding GlobalMappingLayer in LLVM 5
...[](const std::string &Name) { if (auto SymAddr = RTDyldMemoryManager::getSymbolAddressInProcess(Name)) return JITSymbol(SymAddr, JITSymbolFlags::Exported); return JITSymbol(nullptr); }); // Add the set to the JIT with the resolver we created above and a newly // created SectionMemoryManager. return OptimizeLayer.addModule(...
2017 May 07
2
[cfe-dev] JIT doens't resolve address - Resolve obj-Addresses?
...the current process (this is what RTDyldMemoryManager::getSymbolAddressInProcess > does): > > [](const std::string &S) { > printf("PLUSH :0\n"); > if (auto SymAddr = > RTDyldMemoryManager::getSymbolAddressInProcess(S)) > return JITSymbol(SymAddr, JITSymbolFlags::Exported); > return JITSymbol(nullptr); > } > > If, for example, you wanted to redirect calls to printf to your own custom > version (while resolving all other externals by the normal process) you > could change the second lambda like so: > > [](const std::string &S)...
2018 Jun 28
2
Since MCJIT I can't get libm functions to work
...}, >> [](const std::string &Name) { >> if (auto SymAddr = >> llvm::RTDyldMemoryManager::getSymbolAddressInProcess(Name)) >> return llvm::JITSymbol(SymAddr, llvm::JITSymbolFlags::Exported); >> return llvm::JITSymbol(nullptr); >> }); >> >> cantFail(CompileLayer.addModule(std::move(M), >> std::move(Resolver))); >> >> When running the program I...
2019 Aug 14
3
ORC v2 question
Hi Lang, On Tue, 13 Aug 2019 at 23:26, Lang Hames <lhames at gmail.com> wrote: >> I also get this message: >> JIT session error: Symbols not found: { raise_error } > > > Ahh -- I see the problem. The DynamicLibrarySearchGenerator is using the getAddressOfSymbol method, which (under the hood) is basically issuing an appropriate dlsym lookup, and that does not find
2017 Sep 28
0
Question regarding GlobalMappingLayer in LLVM 5
...&Name) { > > if (auto SymAddr = > > RTDyldMemoryManager:: > getSymbolAddressInProcess(Name)) > > return > JITSymbol(SymAddr, JITSymbolFlags::Exported); > > return JITSymbol(nullptr); > > }); > > > > > > // Add the set to the JIT with the resolver we created above and a > newly > > // create...
2020 Apr 13
2
LLVM 10 ORC2 issue with symbol resolution
...>> for (int i = 0; global_syms[i].name != nullptr; i++) { > > >> Symbols.insert({mangle(global_syms[i].name), > > >> > > >> > llvm::JITEvaluatedSymbol(llvm::pointerToJITTargetAddress(global_syms[i].address), > > >> > > >> llvm::JITSymbolFlags(llvm::JITSymbolFlags::FlagNames::Absolute))}); > > >> } > > >> llvm::cantFail(JD.define(llvm::orc::absoluteSymbols(Symbols)), "Failed > > >> to install extern symbols"); > > >> > > >> FYI - my previous post on similar issue. &gt...
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
...), Sym.getFlags()); // If not found as a symbol, look up in current process. // Why doesn't this work? if (auto Addr = llvm::RTDyldMemoryManager::getSymbolAddressInProcess(name)) return llvm::RuntimeDyld::SymbolInfo(Addr, llvm::JITSymbolFlags::Exported); return llvm::RuntimeDyld::SymbolInfo(nullptr); }, // Dylib lookup functor [&](const std::string &name) { return nullptr; } ); Compilelayer.addModuleSet (singletonSet(std::move(M)),...
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...and without "_" (for example "_itoa" but "sin"). > if (Name.length() > 2 && Name[0] == '_') > if (auto SymAddr = RTDyldMemoryManager::getSymbolAddressInProcess( > Name.substr(1))) > return JITSymbol(SymAddr, JITSymbolFlags::Exported); > #endif > > return nullptr; > } - "ready> sin(1.0); Read top-level expression: define double @2() { entry: ret double 0x3FEAED548F090CEE } Evaluated to 0.841471": Actually "sin" is not called at all, LLVM...
2018 Aug 29
2
JIT client - late cross references
...an address of b_trampoline, you can give back an address of a heap-allocated storage, i.e.: ... uint64_t *trampolineStorage = new uint64_t; ... SymbolResolver::findSymbol(const std::string &name) { if (name == "b_trampoline") { JITSymbolInfo((uint64_t) trampolineStorage, JITSymbolFlags::Exported) } ... } Later on, when everything is loaded and you are ready to execute JITed code you can fill in the trampolineStorage with the actual address, i.e.: *trampolineStorage = jit.getSymbol("b").getAddress(); That should do the trick. I still hope I got your problem...
2019 May 09
3
Can I use the JIT interface to create trampolines? (For functions and global values)
Dear LLVM-Mailing list (again), I still have another beginners question in my mind - thank you for your patience. Again I was playing around, but this time with llvm::Function. In an older question I learned, that I can replace a llvm::Function directly with an address. llvm::Function *function = mainModue->getFunction("puts"); function->replaceAllUsesWith(
2018 Aug 29
2
JIT client - late cross references
Hello Lang, thank you for your response! So the use case would be some kind of wrapping or just taking control. Taking that Module 'A' has function a() and Module 'B' has function b() and c() - also a() calls b(). The normal resolving process would resolve the function call correct. But for some reason (like having a wrapper) I would prefer to resolve calls to b() with a call to
2017 Nov 19
2
JIT and atexit crash
...RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) { if (Name == "_atexit") { return findSymbol("mull_custom_test_at_exit"); } if (auto SymAddr = RTDyldMemoryManager::getSymbolAddressInProcess(Name)) return RuntimeDyld::SymbolInfo(SymAddr, JITSymbolFlags::Exported); return RuntimeDyld::SymbolInfo(nullptr); } extern "C" int mull_custom_test_at_exit(void (* p)(void)) { return atexit(p); } The solution removes the crash, but it is not optimal. Best regards, Alex. -- https://lowlevelbits.org -------------- next part ------...
2017 Aug 06
2
Compile issues with LLVM ORC JIT
...in the host process.autoResolver=createLambdaResolver([&](conststd::string &Name){if(autoSym=CompileLayer.findSymbol(Name,false))returnSym;returnJITSymbol(nullptr);},[](conststd::string &Name){if(autoSymAddr=RTDyldMemoryManager::getSymbolAddressInProcess(Name))returnJITSymbol(SymAddr,JITSymbolFlags::Exported);returnJITSymbol(nullptr);});// Add the set to the JIT with the resolver we created above and a newly// created SectionMemoryManager.returncantFail(CompileLayer.addModule(std::move(M),std::move(Resolver)));}JITSymbolfindSymbol(conststd::string Name){std::string MangledName;raw_string...