Page MenuHomeFreeBSD

arm64: Add unwind information to _start

Authored by dchagin on May 26 2023, 8:40 AM.
Referenced Files
Unknown Object (File)
Thu, Sep 14, 4:15 AM
Unknown Object (File)
Aug 27 2023, 2:48 PM
Unknown Object (File)
Aug 14 2023, 4:16 AM
Unknown Object (File)
Aug 13 2023, 6:46 AM
Unknown Object (File)
Jul 31 2023, 2:37 PM
Unknown Object (File)
Jun 29 2023, 10:33 AM
Unknown Object (File)
Jun 21 2023, 10:49 PM
Unknown Object (File)
Jun 21 2023, 2:51 PM


Group Reviewers

The right unwinding stop indicator should be CFI-undefined PC. - 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.

Create an initial frame with 0 lr and fp.
Procedure Call Standard for the ARM 64-bit Architecture (AArch64)
specifies that the end of the frame record chain is indicated by
the address zero in the address for the previous frame.

This is necessary to complete fixing the libunwind for Aarch64.

MFC after: 1 month

Diff Detail

rG FreeBSD src repository
Lint Passed
No Test Coverage
Build Status
Buildable 51699
Build 48590: arc lint + arc unit

Event Timeline

I plan to commit this soon, any objections?

I thought the kernel zeroed these... but I have no objections since my aarch64 fu is weak

In D40277#924038, @imp wrote:

I thought the kernel zeroed these... but I have no objections since my aarch64 fu is weak

For the dynamically linked binaries there is no other proper way to tell the end frame to the unwinder, other than bad heuristic guessing games.
_start is the entry point for binary, which is called by rtld in that case.

This revision is now accepted and ready to land.Jun 20 2023, 12:36 PM

whitespace doesn't match it seems -- tabs vs spaces?


Hmm, looks like a phabricator rendering problems, the patch contains tabs.
Second argument is just arranged to the second arguments