libcxxrt: add padding in __cxa_allocate_* to fix alignment


libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to cxa_allocate_exception put the
unwindHeader at offset 0x58 in
cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7271

Event Timeline