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]

Re: crt{i,n}.o


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)

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