This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Build libgcc_s on Windows


Danny Smith wrote:

+/* Weak symbols do not get resolved if using a Windows dll import lib.
+   Make the unwind registration references strong undefs.  */
+#if DWARF2_UNWIND_INFO
+#define SHARED_LIBGCC_UNDEFS_SPEC \
+ "%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info}"
+#else
+#define SHARED_LIBGCC_UNDEFS_SPEC ""
+#endif

I agree this is the safest way to handle weak linkage in libgcc_s_1.dll While your at it you may as well clean up the use of GetModuleHandle/GetProcAddress to get in cygming-crtbegin.

OK, I will, but there is something that is unclear to me actually.


Why are the references to __register_frame_info in crtbegin weak in the first place? Shouldn't it always be able to find these symbols in libgcc, whether dynamic or not? It's not obvious to me what case there would be where this symbol would not be available.

(The JCR situation makes more sense to me, even if this is a little unfortunate. It might be better to generate undefs that pull in the JCR code only if there are some class definitions.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]