aboutsummaryrefslogtreecommitdiff
path: root/libcxxabi/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/cxa_exception.h20
-rw-r--r--libcxxabi/src/cxa_personality.cpp15
2 files changed, 20 insertions, 15 deletions
diff --git a/libcxxabi/src/cxa_exception.h b/libcxxabi/src/cxa_exception.h
index aa8969e..1c84f75 100644
--- a/libcxxabi/src/cxa_exception.h
+++ b/libcxxabi/src/cxa_exception.h
@@ -47,7 +47,7 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
// In Wasm, a destructor returns its argument
void *(_LIBCXXABI_DTOR_FUNC *exceptionDestructor)(void *);
#else
- void(_LIBCXXABI_DTOR_FUNC* __ptrauth_cxxabi_exception_destructor exceptionDestructor)(void*);
+ void(_LIBCXXABI_DTOR_FUNC *__ptrauth_cxxabi_exception_destructor exceptionDestructor)(void*);
#endif
std::unexpected_handler __ptrauth_cxxabi_unexpected_handler unexpectedHandler;
std::terminate_handler __ptrauth_cxxabi_terminate_handler terminateHandler;
@@ -61,10 +61,10 @@ struct _LIBCXXABI_HIDDEN __cxa_exception {
int propagationCount;
#else
int handlerSwitchValue;
- const unsigned char* __ptrauth_cxxabi_action_record actionRecord;
- const unsigned char* __ptrauth_cxxabi_lsd languageSpecificData;
- void* __ptrauth_cxxabi_catch_temp catchTemp;
- void* __ptrauth_cxxabi_adjusted_ptr adjustedPtr;
+ const unsigned char *__ptrauth_cxxabi_action_record actionRecord;
+ const unsigned char *__ptrauth_cxxabi_lsd languageSpecificData;
+ void *__ptrauth_cxxabi_catch_temp catchTemp;
+ void *__ptrauth_cxxabi_adjusted_ptr adjustedPtr;
#endif
#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
@@ -88,7 +88,7 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
#endif
std::type_info *exceptionType;
- void(_LIBCXXABI_DTOR_FUNC* __ptrauth_cxxabi_exception_destructor exceptionDestructor)(void*);
+ void(_LIBCXXABI_DTOR_FUNC *__ptrauth_cxxabi_exception_destructor exceptionDestructor)(void*);
std::unexpected_handler __ptrauth_cxxabi_unexpected_handler unexpectedHandler;
std::terminate_handler __ptrauth_cxxabi_terminate_handler terminateHandler;
@@ -102,10 +102,10 @@ struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
#else
int handlerSwitchValue;
- const unsigned char* __ptrauth_cxxabi_action_record actionRecord;
- const unsigned char* __ptrauth_cxxabi_lsd languageSpecificData;
- void* __ptrauth_cxxabi_catch_temp catchTemp;
- void* __ptrauth_cxxabi_adjusted_ptr adjustedPtr;
+ const unsigned char *__ptrauth_cxxabi_action_record actionRecord;
+ const unsigned char *__ptrauth_cxxabi_lsd languageSpecificData;
+ void *__ptrauth_cxxabi_catch_temp catchTemp;
+ void *__ptrauth_cxxabi_adjusted_ptr adjustedPtr;
#endif
#if !defined(__LP64__) && !defined(_WIN64) && !defined(_LIBCXXABI_ARM_EHABI)
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index 81ad3a0..4d2c13a 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -564,10 +564,10 @@ get_thrown_object_ptr(_Unwind_Exception* unwind_exception)
namespace
{
-typedef const uint8_t* __ptrauth_scan_results_lsd lsd_ptr_t;
-typedef const uint8_t* __ptrauth_scan_results_action_record action_ptr_t;
+typedef const uint8_t *__ptrauth_scan_results_lsd lsd_ptr_t;
+typedef const uint8_t *__ptrauth_scan_results_action_record action_ptr_t;
typedef uintptr_t __ptrauth_scan_results_landingpad_intptr landing_pad_t;
-typedef void* __ptrauth_scan_results_landingpad landing_pad_ptr_t;
+typedef void *__ptrauth_scan_results_landingpad landing_pad_ptr_t;
struct scan_results
{
@@ -585,12 +585,16 @@ struct scan_results
} // unnamed namespace
} // extern "C"
+#if !defined(_LIBCXXABI_ARM_EHABI)
namespace {
// The logical model for casting authenticated function pointers makes
// it impossible to directly cast them without breaking the authentication,
// as a result we need this pair of helpers.
+//
+// __ptrauth_nop_cast cannot be used here as the authentication schemas include
+// address diversification.
template <typename PtrType>
-[[maybe_unused]] void set_landing_pad_as_ptr(scan_results& results, const PtrType& out) {
+void set_landing_pad_as_ptr(scan_results& results, const PtrType& out) {
union {
landing_pad_t* as_landing_pad;
landing_pad_ptr_t* as_pointer;
@@ -599,7 +603,7 @@ template <typename PtrType>
*u.as_pointer = out;
}
-[[maybe_unused]] static const landing_pad_ptr_t& get_landing_pad_as_ptr(const scan_results& results) {
+static const landing_pad_ptr_t& get_landing_pad_as_ptr(const scan_results& results) {
union {
const landing_pad_t* as_landing_pad;
const landing_pad_ptr_t* as_pointer;
@@ -608,6 +612,7 @@ template <typename PtrType>
return *u.as_pointer;
}
} // unnamed namespace
+#endif
extern "C" {
static