This is the mail archive of the gcc@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: where is the source code generate crtbegin.o (i386)?


* zet:

> Hello, all
>
> where is the source code which generate crtbegin.o (i386)?
>
> gcc-6.2.0-source/libgcc/config/i386 only have ctr1.S/crtn.S, where is
> the others(crtbegin/crtend/crt1, etc)?

See libgcc/Makefile.in:

ifeq ($(CUSTOM_CRTSTUFF),)
# Compile two additional files that are linked with every program
# linked using GCC on systems using COFF or ELF, for the sake of C++
# constructors.
crtbegin$(objext): $(srcdir)/crtstuff.c
        $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN

crtend$(objext): $(srcdir)/crtstuff.c
        $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END


And so on.  libgcc/crtstuff.c is compiled multiple times to yield
different object files.


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