> From: Keith Marshall <keith****@users*****> > Date: Fri, 21 Dec 2018 18:16:48 +0000 > > > MinGW GCC comes with several object files that are used when linking a > > MinGW program: crt1.o, crt2.o, crtbegin.o, and crtend.o. However, in > > the MinGW source distribution I find only the source of one of them: > > crt1.c. Can someone tell me where are the sources of the rest? > > Only the first two of these are provided directly by us; from their > respective dependency listings: > > $ head -1 mingwrt/crt[12].d > ==> mingwrt/crt1.d <== > crt1.o: ../../mingwrt/crt1.c ... > > ==> mingwrt/crt2.d <== > crt2.o: ../../mingwrt/crt1.c ... > > The other two are provided by the upstream GCC Project folks; you'll > find their sources in the GCC source tarball: > > $ head -1 mingw32/libgcc/crt*.dep > ==> mingw32/libgcc/crtbegin.dep <== > crtbegin.o: .../gcc-8.2.0/libgcc/config/i386/cygming-crtbegin.c \ > > ==> mingw32/libgcc/crtend.dep <== > crtend.o: .../gcc-8.2.0/libgcc/config/i386/cygming-crtend.c \ > > ==> mingw32/libgcc/crtfastmath.dep <== > crtfastmath.o: .../gcc-8.2.0/libgcc/config/i386/crtfastmath.c \ Right, thanks. > > I'm asking because about every MinGW program I compile has 2 > > unresolved symbols: ___register_frame_info and > > ___deregister_frame_info, and those seem to come from crtbegin.o, so > > I'd like to look at the source of that to better understand what are > > those symbols and why they stay unresolved. > > Both seem to be defined, as weak symbols, in crtbegin.o: Right. Can you tell more about this? Why are they weak symbols? The GCC sources say something about Java and libgcj.a, but I don't think I understand that. Does that mean these symbols will only be resolved in Java programs, and are provided only for Java?