Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/lib/libunwind



On 2021/05/31 23:32, Joerg Sonnenberger wrote:
On Mon, May 31, 2021 at 12:12:24PM +0000, Rin Okuyama wrote:
There are two numbering schemes for VFPv2 registers: s0-s31 and d0-d15.
The former is used by GCC, and the latter is by LLVM. Since libunwind was
derived from LLVM, it has never supported the former. This results in
crashes for GCC-compiled binaries in exception handler of C++, if it
encounters VFPv2 registers when unwinding frames.

This is only half correct. GCC actually switched at some point.

I don't think so.

At least, when they supported VFPv3 back to 2009:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=854b8a40570fee8d8c22acf21355a8ab88f17557

and when they introduced arm_dbx_register_number(), which converts b/w
internal/DWARF regnum, back to 2005:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=2fa330b29a650365d4d88e4407fdbc2934dcb1b4

they used s0-s31 numbering for d0-d15.

More accurately, I *imagine*, GCC actually switched at some point to use
VFP registers for general purposes (mainly as cache for stack variables
for -O2, as far as I can see). Before this switch, only applications
using floating-point arithmetic were affected. But, after that, most
C++ applications became affected, and the problem got visible to us.

Thanks,
rin


Joerg



Home | Main Index | Thread Index | Old Index