From ae7c8a2bb8d926e24ef7ccf3a3e091d2d1fbc280 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Sat, 28 Oct 2000 21:26:48 +0000 Subject: * Bring back the guts of crt{i,n}.S. This allows C++ exceptions to work when using the egcs and gcc-devel ports, along with GCC built from stock public FSF sources. With out this change, FreeBSD will be removed from the list of systems GCC 3.0 must be evaluated on before release. With the effort some of us put into getting FreeBSD on this list, we should not turn this effort into a waste, else we might not be worth fighting for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S are needed) * Switch from our own crt{begin,in} to those created from GCC's crtstuff.c. This will allow us to switch to DWARF2 exceptions in the future, along with staying in sync with any future GCC requirements. * Break out our ELF branding bits into a seperate file. Currently this is now included by our crt1.c files (since this functionality was part of our native crtbegin.c). Later crtbrand.o will be merged in the creation of crti.o. --- lib/csu/amd64/Makefile | 6 +++--- lib/csu/amd64/crt1.c | 1 + lib/csu/amd64/crti.S | 15 +++++++++++---- lib/csu/amd64/crtn.S | 9 +++++---- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'lib/csu/amd64') diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile index 70e66b16d165..2082a7050069 100644 --- a/lib/csu/amd64/Makefile +++ b/lib/csu/amd64/Makefile @@ -2,11 +2,11 @@ # $FreeBSD$ # -SRCS= crt1.c crtbegin.c crtend.c crti.S crtn.S +SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= gcrt1.o -SOBJS= crtbegin.So crtend.So -CFLAGS+= -elf -Wall -fkeep-inline-functions +CFLAGS+= -elf -Wall -fkeep-inline-functions \ + -I${.CURDIR}/../common LDFLAGS+= -elf NOMAN= true NOPIC= true diff --git a/lib/csu/amd64/crt1.c b/lib/csu/amd64/crt1.c index 0ee070227107..ad1d25f95b81 100644 --- a/lib/csu/amd64/crt1.c +++ b/lib/csu/amd64/crt1.c @@ -31,6 +31,7 @@ #include #include +#include "crtbrand.c" typedef void (*fptr)(void); diff --git a/lib/csu/amd64/crti.S b/lib/csu/amd64/crti.S index 536d2c243efa..82b262f4dcbe 100644 --- a/lib/csu/amd64/crti.S +++ b/lib/csu/amd64/crti.S @@ -25,7 +25,14 @@ * $FreeBSD$ */ -/* - * This file is not used any more. It will go away as soon as the gcc - * linker specs have been updated accordingly. - */ + .section .init,"ax",@progbits + .align 4 + .globl _init + .type _init,@function +_init: + + .section .fini,"ax",@progbits + .align 4 + .globl _fini + .type _fini,@function +_fini: diff --git a/lib/csu/amd64/crtn.S b/lib/csu/amd64/crtn.S index 536d2c243efa..361ab1e2e157 100644 --- a/lib/csu/amd64/crtn.S +++ b/lib/csu/amd64/crtn.S @@ -25,7 +25,8 @@ * $FreeBSD$ */ -/* - * This file is not used any more. It will go away as soon as the gcc - * linker specs have been updated accordingly. - */ + .section .init,"ax",@progbits + ret + + .section .fini,"ax",@progbits + ret -- cgit v1.3