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

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.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D158241
This commit is contained in:
Fangrui Song
2023-08-23 13:00:36 -07:00
parent ffa7c7897c
commit be91bd0121

View File

@@ -70,11 +70,7 @@ GCC_4.3.0 { __bswapdi2; __bswapsi2; __emutls_get_address; };
#endif
#if defined(GLOBAL_X86)
GCC_3.0 {
__deregister_frame_info_bases; __fixunsxfdi; __register_frame_info_bases;
__register_frame_info_table_bases;
};
GCC_3.0 { __fixunsxfdi; };
GCC_4.0.0 { __divxc3; __mulxc3; __powixf2; };
GCC_4.8.0 { __cpu_indicator_init; };
#endif
@@ -148,17 +144,11 @@ GCC_4.3.0 { __bswapdi2; __bswapsi2; __emutls_get_address; };
#if defined(__i386__)
GCC_3.0 { __fixunsxfsi; __fixxfdi; __floatdixf; };
GCC_4.2.0 { __floatundixf; };
GLIBC_2.0 {
__register_frame_info; __register_frame_info_table; __register_frame_table;
__deregister_frame_info;
};
#endif
#if defined(__x86_64__)
GCC_3.0 {
__register_frame_info; __register_frame_info_table; __register_frame_table;
__deregister_frame; __deregister_frame_info; __register_frame;
__deregister_frame; __register_frame;
__fixunsxfti; __fixxfti; __floattixf;
};