aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_kvm_syzos.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common_kvm_syzos.h')
-rw-r--r--executor/common_kvm_syzos.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/executor/common_kvm_syzos.h b/executor/common_kvm_syzos.h
index a635d517b..be530319e 100644
--- a/executor/common_kvm_syzos.h
+++ b/executor/common_kvm_syzos.h
@@ -12,8 +12,11 @@
// TODO(glider): once syz-env-old migrates to GCC>11 we can just use
// __attribute__((no_stack_protector)).
#if defined(__clang__)
+
// Clang supports the no_stack_protector attribute.
#define __no_stack_protector __attribute__((no_stack_protector))
+#define __addrspace_guest __attribute__((address_space(10)))
+
#elif defined(__GNUC__)
// The no_stack_protector attribute was introduced in GCC 11.1.
#if __GNUC__ > 11
@@ -22,12 +25,15 @@
// Fallback to the optimize attribute for older GCC versions.
#define __no_stack_protector __attribute__((__optimize__("-fno-stack-protector")))
#endif
+#define __addrspace_guest
+
#else
#define __no_stack_protector
+#define __addrspace_guest
#endif
// Host will map the code in this section into the guest address space.
-#define GUEST_CODE __attribute__((section("guest"))) __no_stack_protector
+#define GUEST_CODE __attribute__((section("guest"))) __no_stack_protector __addrspace_guest
// Start/end of the guest section.
extern char *__start_guest, *__stop_guest;