lli's remote MCJIT code calls setExecutable just prior to running
code. In line with Darwin behaviour this seems to be the place to
invalidate any caches needed so that relocations can take effect
properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182213
91177308-0d34-0410-b5e6-
96231b3b80d8
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)M.Address,
(vm_size_t)M.Size, 0, VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_COPY);
return KERN_SUCCESS == kr;
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)M.Address,
(vm_size_t)M.Size, 0, VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_COPY);
return KERN_SUCCESS == kr;
+#elif defined(__arm__) || defined(__aarch64__)
+ Memory::InvalidateInstructionCache(M.Address, M.Size);
+ return true;
#else
return true;
#endif
#else
return true;
#endif
+++ /dev/null
-config.suffixes = ['.ll', '.c', '.cpp']
-
-def getRoot(config):
- if not config.parent:
- return config
- return getRoot(config.parent)
-
-root = getRoot(config)
-
-if 'arm' in root.target_triple:
- config.unsupported = True
; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false %s
; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false %s
; The intention of this test is to verify that symbols mapped to COMMON in ELF
; work as expected.
; The intention of this test is to verify that symbols mapped to COMMON in ELF
; work as expected.
; RUN: %lli_mcjit -remote-mcjit -O0 %s
; RUN: %lli_mcjit -remote-mcjit -O0 %s
; Check that a variable is always aligned as specified.
; Check that a variable is always aligned as specified.
; RUN: %lli_mcjit -remote-mcjit %s > /dev/null
; RUN: %lli_mcjit -remote-mcjit %s > /dev/null
@count = global i32 1, align 4
@count = global i32 1, align 4
; RUN: %lli_mcjit -remote-mcjit -O0 %s
; RUN: %lli_mcjit -remote-mcjit -O0 %s
@.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
@ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4
@.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
@ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4