This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: crt{i,n}.o
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: crt{i,n}.o
- From: "David O'Brien" <obrien at FreeBSD dot org>
- Date: Tue, 24 Oct 2000 13:36:27 -0700
- Cc: gcc at gcc dot gnu dot org
- Organization: The NUXI BSD group
- References: <20001024045816.A84779@dragon.nuxi.com> <jmitqinhmm.fsf@envy.cygnus.com>
- Reply-To: obrien at FreeBSD dot org
On Tue, Oct 24, 2000 at 12:50:25PM -0700, Geoff Keating wrote:
> > Since GCC provides its own crtbegin.o and crtend.o, why doesn't it
> > provide its own crti.o and crtn.o?
>
> crti.o and crtn.o are, by definition, provided by the target system.
Why isn't crt{begin,end}.o by definition not provided by the target
system? (I don't have full ELF ABI specs)
> What assumption?
FreeBSD's 4.1.1's /usr/lib/crt{i,n} doesn't have the bits GCC's crtstuff
wants:
.section .init,"ax",@progbits
.align 4
.globl _init
.type _init,@function
_init:
.section .fini,"ax",@progbits
.align 4
.globl _fini
.type _fini,@function
_fini:
and
.section .init,"ax",@progbits
ret
.section .fini,"ax",@progbits
ret
ie, that _init and _fini are registered and return at the end.
We have our own /usr/lib/crt{begin,end}.o that works fine with TenDRA
(another C/C++ compiler). However, I've been pushed to abandon our
native crt{begin,end}.o because G++ is best supported by it (ie, G++
assumes things are done the way crtstuff.c does them). Thus stock builds
of GCC 2.97 have broken exceptions for instance.
--
-- David (obrien@FreeBSD.org)