|
47 | 47 |
|
48 | 48 | #include <ptrauth.h> |
49 | 49 |
|
| 50 | + // `__ptrauth_restricted_intptr` is a feature of apple clang that predates |
| 51 | + // support for direct application of `__ptrauth` to integer types. This |
| 52 | + // guard is necessary to support compilation with those compiler. |
50 | 53 | #if __has_extension(ptrauth_restricted_intptr_qualifier) |
51 | 54 | #define __unwind_ptrauth_restricted_intptr(...) \ |
52 | 55 | __ptrauth_restricted_intptr(__VA_ARGS__) |
|
55 | 58 | __ptrauth(__VA_ARGS__) |
56 | 59 | #endif |
57 | 60 |
|
58 | | -// ptrauth_string_discriminator("unw_proc_info_t::handler") == 0x7405 |
| 61 | + // ptrauth_string_discriminator("unw_proc_info_t::handler") == 0x7405 |
59 | 62 | #define __ptrauth_unwind_upi_handler_disc 0x7405 |
60 | 63 |
|
61 | 64 | #define __ptrauth_unwind_upi_handler \ |
|
65 | 68 | __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1,\ |
66 | 69 | __ptrauth_unwind_upi_handler_disc) |
67 | 70 |
|
68 | | -// ptrauth_string_discriminator("unw_proc_info_t::start_ip") == 0xCA2C |
| 71 | + // ptrauth_string_discriminator("unw_proc_info_t::start_ip") == 0xCA2C |
69 | 72 | #define __ptrauth_unwind_upi_startip \ |
70 | 73 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_independent_code, 1, 0xCA2C) |
71 | 74 |
|
72 | | -// ptrauth_string_discriminator("unw_proc_info_t::end_ip") == 0xE183 |
| 75 | + // ptrauth_string_discriminator("unw_proc_info_t::end_ip") == 0xE183 |
73 | 76 | #define __ptrauth_unwind_upi_endip \ |
74 | 77 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_independent_code, 1, 0xE183) |
75 | 78 |
|
76 | | -// ptrauth_string_discriminator("unw_proc_info_t::lsda") == 0x83DE |
| 79 | + // ptrauth_string_discriminator("unw_proc_info_t::lsda") == 0x83DE |
77 | 80 | #define __ptrauth_unwind_upi_lsda \ |
78 | 81 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x83DE) |
79 | 82 |
|
80 | | -// ptrauth_string_discriminator("unw_proc_info_t::flags") == 0x79A1 |
| 83 | + // ptrauth_string_discriminator("unw_proc_info_t::flags") == 0x79A1 |
81 | 84 | #define __ptrauth_unwind_upi_flags \ |
82 | 85 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x79A1) |
83 | 86 |
|
84 | | -// ptrauth_string_discriminator("unw_proc_info_t::unwind_info") == 0xC20C |
| 87 | + // ptrauth_string_discriminator("unw_proc_info_t::unwind_info") == 0xC20C |
85 | 88 | #define __ptrauth_unwind_upi_info \ |
86 | 89 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0xC20C) |
87 | 90 |
|
88 | | -// ptrauth_string_discriminator("unw_proc_info_t::extra") == 0x03DF |
| 91 | + // ptrauth_string_discriminator("unw_proc_info_t::extra") == 0x03DF |
89 | 92 | #define __ptrauth_unwind_upi_extra \ |
90 | 93 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x03DF) |
91 | 94 |
|
92 | | -// ptrauth_string_discriminator("Registers_arm64::link_reg_t") == 0x8301 |
| 95 | + // ptrauth_string_discriminator("Registers_arm64::link_reg_t") == 0x8301 |
93 | 96 | #define __ptrauth_unwind_registers_arm64_link_reg \ |
94 | 97 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_code, 1, 0x8301) |
95 | 98 |
|
96 | | -// ptrauth_string_discriminator("UnwindInfoSections::dso_base") == 0x4FF5 |
| 99 | + // ptrauth_string_discriminator("UnwindInfoSections::dso_base") == 0x4FF5 |
97 | 100 | #define __ptrauth_unwind_uis_dso_base \ |
98 | 101 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x4FF5) |
99 | 102 |
|
100 | | -// ptrauth_string_discriminator("UnwindInfoSections::dwarf_section") == 0x4974 |
| 103 | + // ptrauth_string_discriminator("UnwindInfoSections::dwarf_section") == 0x4974 |
101 | 104 | #define __ptrauth_unwind_uis_dwarf_section \ |
102 | 105 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x4974) |
103 | 106 |
|
104 | | -// ptrauth_string_discriminator("UnwindInfoSections::dwarf_section_length") == 0x2A9A |
| 107 | + // ptrauth_string_discriminator("UnwindInfoSections::dwarf_section_length") == 0x2A9A |
105 | 108 | #define __ptrauth_unwind_uis_dwarf_section_length \ |
106 | 109 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x2A9A) |
107 | 110 |
|
108 | | -// ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section") == 0xA27B |
| 111 | + // ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section") == 0xA27B |
109 | 112 | #define __ptrauth_unwind_uis_compact_unwind_section \ |
110 | 113 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0xA27B) |
111 | 114 |
|
112 | | -// ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section_length") == 0x5D0A |
| 115 | + // ptrauth_string_discriminator("UnwindInfoSections::compact_unwind_section_length") == 0x5D0A |
113 | 116 | #define __ptrauth_unwind_uis_compact_unwind_section_length \ |
114 | 117 | __unwind_ptrauth_restricted_intptr(ptrauth_key_process_dependent_data, 1, 0x5D0A) |
115 | 118 |
|
116 | | -// ptrauth_string_discriminator("CIE_Info::personality") == 0x6A40 |
| 119 | + // ptrauth_string_discriminator("CIE_Info::personality") == 0x6A40 |
117 | 120 | #define __ptrauth_unwind_cie_info_personality_disc 0x6A40 |
118 | 121 | #define __ptrauth_unwind_cie_info_personality \ |
119 | 122 | __unwind_ptrauth_restricted_intptr(ptrauth_key_function_pointer, 1, \ |
120 | 123 | __ptrauth_unwind_cie_info_personality_disc) |
121 | 124 |
|
122 | | -// ptrauth_string_discriminator("personality") == 0x7EAD) |
123 | | - #define __ptrauth_unwind_pacret_personality_disc 0x7EAD |
| 125 | + // ptrauth_string_discriminator("personality") == 0x7EAD) |
| 126 | + #define __ptrauth_unwind_pauthtest_personality_disc 0x7EAD |
124 | 127 |
|
125 | 128 | #else |
126 | 129 |
|
|
0 commit comments