Prior to the addition of the referenceCount in __cxa_exception the unwindHeader was at offset 0x50, and it requires 16-byte alignment. Add padding in the same location that it will appear in libstdc++.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Here's a libstdc++ bug for a nearly identical issue issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732
See specifically comment 13: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38732#c13
Avoid changing the __cxa_exception ABI in 11.
The addition of the referenceCount to __cxa_allocate_exception put the unwindHeader at offset 0x58, but it requires 16-byte alignment. In order to avoid changing the broken __cxa_exception ABI (and thus breaking its consumers), add explicit padding in the allocation routins (and account for it when freeing).
contrib/libcxxrt/exception.cc | ||
---|---|---|
576–582 ↗ | (On Diff #18633) | Should this be // comments instead? |
LGTM. This looks like the least intrusive solution.
contrib/libcxxrt/exception.cc | ||
---|---|---|
576–582 ↗ | (On Diff #18633) | Not necessary, for instance the block below it uses /**, which appears to be used for longer comments (though not very consistently). |
head/contrib/libcxxrt/exception.cc | ||
---|---|---|
583 | It would be nice if this could be computed with offsetof(), sizeof() and alignof(), rather than being hard-coded. |