]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
csu: Implement _start using as to satisfy unwinders on x86_64
authorDmitry Chagin <dchagin@FreeBSD.org>
Thu, 29 Jun 2023 16:34:39 +0000 (19:34 +0300)
committerDmitry Chagin <dchagin@FreeBSD.org>
Thu, 29 Jun 2023 16:34:39 +0000 (19:34 +0300)
commitc969310c992a12459ed4025c1cd8b22f29c763b5
tree0eecfc0ca6b804ab2f8769b7f2ea8f526d97e655
parentc09909ed889f4722e68b192e206dff1b03182edb
csu: Implement _start using as to satisfy unwinders on x86_64

The right unwinding stop indicator should be CFI-undefined PC.
https://dwarfstd.org/doc/Dwarf3.pdf - page 118:
If a Return Address register is defined in the virtual unwind table,
and its rule is undefined (for example, by DW_CFA_undefined), then
there is no return address and no call address, and the virtual
unwind of stack activations is complete.

This requires the crt code be built with unwind tables, for that remove
-fno-asynchronous-unwind-tables to enable unwind tables generation.

PR: 241562, 246322, 246537
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40780
lib/csu/Makefile.inc
lib/csu/amd64/Makefile
lib/csu/amd64/crt1_c.c
lib/csu/amd64/crt1_s.S [new file with mode: 0644]