aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-02-18 21:30:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-02-18 21:30:27 +0000
commit0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 (patch)
treec16efd74ab816c1fbecddddef3d52dc1982f91a5
parent04d2d2d7fd22bba638ccb5a0b2e0805087a70cd3 (diff)
parent3f8a54b20893fe39cf81775e18be6c4353bd2a48 (diff)
downloadsrc-0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368.tar.gz
src-0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368.zip
Merge libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456
Interesting fixes: b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877 7b2335c Mostly fix __cxa_demangle after #3 Reported by: arichardson PR: 253226 MFC after: 3 days
-rw-r--r--contrib/libcxxrt/libelftc_dem_gnu3.c14
-rw-r--r--contrib/libcxxrt/unwind-arm.h3
-rw-r--r--contrib/libcxxrt/unwind-itanium.h10
3 files changed, 20 insertions, 7 deletions
diff --git a/contrib/libcxxrt/libelftc_dem_gnu3.c b/contrib/libcxxrt/libelftc_dem_gnu3.c
index a8d061591826..6e88f7b4bb4c 100644
--- a/contrib/libcxxrt/libelftc_dem_gnu3.c
+++ b/contrib/libcxxrt/libelftc_dem_gnu3.c
@@ -541,9 +541,19 @@ __cxa_demangle_gnu3(const char *org)
char *rtn;
bool has_ret, more_type;
- if (org == NULL || (org_len = strlen(org)) < 2)
+ if (org == NULL)
return (NULL);
+ org_len = strlen(org);
+ // Try demangling as a type for short encodings
+ if ((org_len < 2) || (org[0] != '_' || org[1] != 'Z' )) {
+ if (!cpp_demangle_data_init(&ddata, org))
+ return (NULL);
+ if (!cpp_demangle_read_type(&ddata, 0))
+ goto clean;
+ rtn = vector_str_get_flat(&ddata.output, (size_t *) NULL);
+ goto clean;
+ }
if (org_len > 11 && !strncmp(org, "_GLOBAL__I_", 11)) {
if ((rtn = malloc(org_len + 19)) == NULL)
return (NULL);
@@ -552,8 +562,6 @@ __cxa_demangle_gnu3(const char *org)
return (rtn);
}
- if (org[0] != '_' || org[1] != 'Z')
- return (NULL);
if (!cpp_demangle_data_init(&ddata, org + 2))
return (NULL);
diff --git a/contrib/libcxxrt/unwind-arm.h b/contrib/libcxxrt/unwind-arm.h
index a4bf1bd058bc..ec81237e573b 100644
--- a/contrib/libcxxrt/unwind-arm.h
+++ b/contrib/libcxxrt/unwind-arm.h
@@ -29,6 +29,7 @@
*/
typedef enum
{
+ _URC_NO_REASON = 0,
_URC_OK = 0, /* operation completed successfully */
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_END_OF_STACK = 5,
@@ -96,7 +97,7 @@ struct _Unwind_Exception
} pr_cache;
/** Force alignment of next item to 8-byte boundary */
long long int :0;
-};
+} __attribute__((__aligned__(8)));
/* Unwinding functions */
_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *ucbp);
diff --git a/contrib/libcxxrt/unwind-itanium.h b/contrib/libcxxrt/unwind-itanium.h
index 0ca9488605aa..199d91de283d 100644
--- a/contrib/libcxxrt/unwind-itanium.h
+++ b/contrib/libcxxrt/unwind-itanium.h
@@ -40,6 +40,7 @@ extern "C" {
typedef enum
{
_URC_NO_REASON = 0,
+ _URC_OK = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
@@ -78,9 +79,12 @@ struct _Unwind_Exception
{
uint64_t exception_class;
_Unwind_Exception_Cleanup_Fn exception_cleanup;
- unsigned long private_1;
- unsigned long private_2;
- } ;
+ uintptr_t private_1;
+ uintptr_t private_2;
+#if __SIZEOF_POINTER__ == 4
+ uint32_t reserved[3];
+#endif
+ } __attribute__((__aligned__));
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,