summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
AgeCommit message (Collapse)Author
2025-04-03[JITLink][XCOFF] Setup initial build support for XCOFF (#127266)Henry Jiang
This patch starts the initial implementation of JITLink for XCOFF (Object format for AIX).
2024-12-06[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)Jared Wyles
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning on the boundary between JITLink and ORC, and allows pointer comparisons (rather than string comparisons) between Symbol names. This should improve the performance and readability of code that bridges between JITLink and ORC (e.g. ObjectLinkingLayer and ObjectLinkingLayer::Plugins). To enable use of SymbolStringPtr a std::shared_ptr<SymbolStringPool> is added to LinkGraph and threaded through to its construction sites in LLVM and Bolt. All LinkGraphs that are to have symbol names compared by pointer equality must point to the same SymbolStringPool instance, which in ORC sessions should be the pool attached to the ExecutionSession. --------- Co-authored-by: Lang Hames <lhames@gmail.com>
2024-11-19[ExecutionEngine] Remove unused includes (NFC) (#116749)Kazu Hirata
Identified with misc-include-cleaner.
2023-12-11[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)Kazu Hirata
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-02-11[ORC] Move ORC-specific object format details into OrcShared.Lang Hames
This allows these details to be shared with JITLink, which is allowed to depend on the OrcShared library (but not on OrcJIT).
2022-12-12[ORC] Extract hasInitializerSection for testing (NFC)Keith Smiley
Based on the discussion in https://reviews.llvm.org/D130221 and https://reviews.llvm.org/D139223 Differential Revision: https://reviews.llvm.org/D139347
2022-12-02[llvm] Use std::nullopt instead of None (NFC)Kazu Hirata
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-26[Orc] Use std::optional in ObjectFileInterface.cpp (NFC)Kazu Hirata
This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-08-13[ORC_RT][COFF] Initial platform support for COFF/x86_64.Sunho Kim
Initial platform support for COFF/x86_64. Completed features: * Statically linked orc runtime. * Full linking/initialization of static/dynamic vc runtimes and microsoft stl libraries. * SEH exception handling. * Full static initializers support * dlfns * JIT side symbol lookup/dispatch Things to note: * It uses vc runtime libraries found in vc toolchain installations. * Bootstrapping state is separated because when statically linking orc runtime it needs microsoft stl functions to initialize the orc runtime, but static initializers need to be ran in order to fully initialize stl libraries. * Process symbols can't be used blidnly on msvc platform; otherwise duplicate definition error gets generated. If process symbols are used, it's destined to get out-of-reach error at some point. * Atexit currently not handled -- will be handled in the follow-up patches. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D130479
2022-07-25[ORC][COFF] Properly set weak flag to COMDAT symbols.Sunho Kim
Properly set weak flag to COMDAT symbols so that no duplicate definition error will be generated. There is an inaccuracy in setting plain weak for largest selection type, which will be dealt with soon when largest type is properly implemented. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129764
2022-07-13[JITLink][COFF] Initial COFF support.Sunho Kim
Adds initial COFF support in JITLink. This is able to run a hello world c program in x86 windows successfully. Implemented - COFF object loader - Static local symbols - Absolute symbols - External symbols - Weak external symbols - Common symbols - COFF jitlink-check support - All COMDAT selection type execpt largest - Implicit symobl size calculation - Rel32 relocation with PLT stub. - IMAGE_REL_AMD64_ADDR32NB relocation Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D128968
2022-05-19[ORC] Avoid more SymbolStringPtr copies.Lang Hames
2021-12-15[ORC] Add MaterializationUnit::Interface parameter to ObjectLayer::add.Lang Hames
Also moves object interface building functions out of Mangling.h and in to the new ObjectFileInterfaces.h header, and updates the llvm-jitlink tool to use custom object interfaces rather than a custom link layer. ObjectLayer::add overloads are added to match the old signatures (which do not take a MaterializationUnit::Interface). These overloads use the standard getObjectFileInterface function to build an interface. Passing a MaterializationUnit::Interface explicitly makes it easier to alter the effective interface of the object file being added, e.g. by changing symbol visibility/linkage, or renaming symbols (in both cases the changes will need to be mirrored by a JITLink pass at link time to update the LinkGraph to match the explicit interface). Altering interfaces in this way can be useful when lazily compiling (e.g. for renaming function bodies) or emulating linker options (e.g. demoting all symbols to hidden visibility to emulate -load_hidden).