@@ -49,12 +49,13 @@ struct capreloc {
49
49
};
50
50
static const __SIZE_TYPE__ function_reloc_flag = (__SIZE_TYPE__ )1
51
51
<< (__SIZE_WIDTH__ - 1 );
52
+ static const __SIZE_TYPE__ constant_reloc_flag = (__SIZE_TYPE__ )1
53
+ << (__SIZE_WIDTH__ - 2 );
54
+ #ifdef __riscv_xcheri
52
55
static const __SIZE_TYPE__ function_pointer_permissions_mask =
53
56
~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_PERMIT_SEAL__ |
54
57
__CHERI_CAP_PERMISSION_PERMIT_STORE_CAPABILITY__ |
55
58
__CHERI_CAP_PERMISSION_PERMIT_STORE__ );
56
- static const __SIZE_TYPE__ constant_reloc_flag = (__SIZE_TYPE__ )1
57
- << (__SIZE_WIDTH__ - 2 );
58
59
static const __SIZE_TYPE__ constant_pointer_permissions_mask =
59
60
~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_PERMIT_SEAL__ |
60
61
__CHERI_CAP_PERMISSION_PERMIT_STORE_CAPABILITY__ |
@@ -64,6 +65,18 @@ static const __SIZE_TYPE__ constant_pointer_permissions_mask =
64
65
static const __SIZE_TYPE__ global_pointer_permissions_mask =
65
66
~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_PERMIT_SEAL__ |
66
67
__CHERI_CAP_PERMISSION_PERMIT_EXECUTE__ );
68
+ #else
69
+ static const __SIZE_TYPE__ function_pointer_permissions_mask =
70
+ ~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_WRITE__ );
71
+ static const __SIZE_TYPE__ constant_pointer_permissions_mask =
72
+ ~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_WRITE__ |
73
+ #ifdef __riscv_zcherilevels
74
+ __CHERI_CAP_PERMISSION_STORE_LEVEL__ |
75
+ #endif
76
+ __CHERI_CAP_PERMISSION_EXECUTE__ );
77
+ static const __SIZE_TYPE__ global_pointer_permissions_mask =
78
+ ~(__SIZE_TYPE__ )(__CHERI_CAP_PERMISSION_EXECUTE__ );
79
+ #endif
67
80
68
81
__attribute__((weak )) extern struct capreloc __start___cap_relocs ;
69
82
__attribute__((weak )) extern struct capreloc __stop___cap_relocs ;
0 commit comments