Skip to content

Commit

Permalink
[llvm-libgcc] Don't export __{,de}register_frame_info* and __register…
Browse files Browse the repository at this point in the history
…_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
  • Loading branch information
MaskRay committed Aug 23, 2023
1 parent ffa7c78 commit be91bd0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions llvm-libgcc/lib/gcc_s.ver
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit be91bd0

Please sign in to comment.