[llvm-dev] [ORC JIT] Getting symbols from object files before any lookup is done
Gaier, Bjoern via llvm-dev
llvm-dev at lists.llvm.org
Wed Apr 22 04:51:50 PDT 2020
Hello LLVM-Mailing-List and hello Lang (I figured somebody would add you....so I did it directly. Sorry),
I'm still playing around with the ORC JIT version which is available in LLVM 10. My goal is to get the address of every defined symbol in a module and an object file before the code is emitted. With the help of Lang I do this now with the lookup function of the Execution Session. Thank you for this!
However, my next issue is: How can I find every defined symbol in my object files? Currently I attached a callback function with the "setNotifyLoaded" function of "RTDyldObjectLinkingLayer". Which is really handy, because I can simply iterate over the symbols of the object files.
However this only works when I already know what is inside my object files, which kinda kills the purpose.
For a workaround I iterate through all the global symbols and functions of the IR module I'm loading, skipping symbols that are not defined in the module. However, I noticed when I do a lookup on those symbols, I will get some "additional" symbols from the notify loaded callback function having addresses I will miss then. Also this does not help me when I'm loading an object file from disk cause I don't have such a function there.
Okay... explaining stuff is not my best practise so.... Here a tl;dr:
How can I get all symbols from an object file when it is loaded/added to ORC JIT?
Sorry that I still have questions >o<
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev