Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EraVM] Add support of factory dependencies
This patch generalizes relocatable symbols which are used to support EraVM-specific linkage scenarios. Two types of symbols are supported by now - 'linker symbol', size - 20 bytes - 'factory dependency', size - 32 bytes The symbols usage looks following 1. 'LLVM IR' level There are two intrinsics whose arguments represent symbol names: i256 @llvm.eravm.linkersymbol(metadata) i256 @llvm.eravm.factorydependency(metadata) 2. 'Machine IR' level There are two corresponding machine instructions with MCSymbol arguments: LinkeSymbol '@name' (MCSymbol) FactoryDependency '@name' MCSymbol 3. 'LLVM MC' object level Each symbol is transformed into several sub-symbols (4-byte size each) 'name' -> 'prefix'+keccak256('name')+'_subId', where 'prefix' is either '__linker_symbol' or '__factory_dependency'. 'subId' = [0-4], for linker symbols, [0-7] for factory dependencies. 4. Linker level Definitions for the reference symbols are provided via the EraVM LLD API and then the linker performs required relocations.
- Loading branch information