Page MenuHomeFreeBSD

rtld: Annotate .rtld_start on i386
ClosedPublic

Authored by dchagin on Jul 9 2023, 12:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 7:33 AM
Unknown Object (File)
Sat, Jun 15, 1:29 PM
Unknown Object (File)
May 25 2024, 4:38 AM
Unknown Object (File)
May 12 2024, 11:10 AM
Unknown Object (File)
Mar 13 2024, 3:05 AM
Unknown Object (File)
Mar 13 2024, 2:41 AM
Unknown Object (File)
Feb 17 2024, 8:18 PM
Unknown Object (File)
Jan 28 2024, 4:57 AM
Subscribers

Details

Summary

Add a stop indicator to rtld_start to satisfy unwinders:
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.

That is allows gdb and libunwind successfully stop when unwinding stack
from global constructors and destructors.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Still adding frame location annotations would be useful.

This revision is now accepted and ready to land.Jul 9 2023, 1:48 PM

It was the first variant, mostly due to dwarf forbids %esi as CFA

This revision now requires review to proceed.Jul 9 2023, 4:48 PM
This revision is now accepted and ready to land.Jul 9 2023, 11:29 PM
This revision was automatically updated to reflect the committed changes.