This is an archive of the discontinued LLVM Phabricator instance.

[llvm-libgcc] Don't export __{,de}register_frame_info* and __register_frame_table
ClosedPublic

Authored by MaskRay on Aug 17 2023, 7:08 PM.

Details

Summary

These symbols are used in the absence of PT_GNU_EH_FRAME, for ld
--no-eh-frame-hdr (gcc -static default).

libunwind defines these empty functions when
defined(_LIBUNWIND_BUILD_ZERO_COST_APIS) && defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_SUPPORT_FRAME_APIS).
They should be perceived as Mac OS X workarounds.

For Linux, GCC crtbeginT.o (for -static) and clang_rt.crtbegin.o contain
weak references to __{,de}register_frame_info. Dynamically linked
executables will either not reference __{,de}register_frame_info (using
libgcc) or reference them as weak symbols (using compiler-rt).

Therefore, not defining these symbols is backward compatible.

Diff Detail

Event Timeline

MaskRay created this revision.Aug 17 2023, 7:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2023, 7:08 PM
MaskRay requested review of this revision.Aug 17 2023, 7:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2023, 7:08 PM
MaskRay edited the summary of this revision. (Show Details)Aug 17 2023, 7:09 PM
MaskRay edited the summary of this revision. (Show Details)

Ping:)

phosek accepted this revision.Aug 23 2023, 10:35 AM

LGTM

This revision is now accepted and ready to land.Aug 23 2023, 10:35 AM
This revision was landed with ongoing or failed builds.Aug 23 2023, 1:00 PM
This revision was automatically updated to reflect the committed changes.
cjdb added a comment.Aug 23 2023, 2:23 PM

Sorry, I didn't see the original email. Thanks for the patch: the reasoning makes sense to me.