Page MenuHomeFreeBSD

libunwind: make __{de,}register_frame compatible with libgcc API
ClosedPublic

Authored by emaste on Dec 20 2016, 2:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 3:49 PM
Unknown Object (File)
Tue, Apr 30, 8:32 AM
Unknown Object (File)
Tue, Apr 30, 4:56 AM
Unknown Object (File)
Jan 1 2024, 1:42 PM
Unknown Object (File)
Dec 25 2023, 12:49 PM
Unknown Object (File)
Dec 20 2023, 5:37 AM
Unknown Object (File)
Dec 1 2023, 2:05 PM
Unknown Object (File)
Nov 23 2023, 11:01 AM
Subscribers

Details

Summary

The libgcc __register_frame and __deregister_frame functions take a pointer to a set of FDE/CIEs, terminated by an entry with length = 0.
In Apple's implementation the pointer is assumed to be to a single FDE. I suspect this is just a bug.

Make us compatible with libgcc instead.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste retitled this revision from to libunwind: make __{de,}register_frame compatible with libgcc API.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: dim.
contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c
231 ↗(On Diff #23140)

This might not be alignment-safe. Maybe we can reuse some get() macro here? Otherwise, we should use memcpy. Similar for the following char-to-larger-type pointer casts.

272 ↗(On Diff #23140)

Aren't we missing an #endif here?

Fix typos and missing #endif

contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c
231 ↗(On Diff #23140)

I cribbed from LLVM's RTDyldMemoryManager.cpp, and I think this is indeed worth improving. Right now though libunwind is used only on amd64 / i386 / arm64.

dim edited edge metadata.

Ok, then it looks good to me. Maybe add a small comment that this could be improved using alignment-neutral code, in the future.

This revision is now accepted and ready to land.Dec 20 2016, 9:32 PM
This revision was automatically updated to reflect the committed changes.