summaryrefslogtreecommitdiffstats
path: root/lib/csu/common
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-10-28 21:26:48 +0000
committerobrien <obrien@FreeBSD.org>2000-10-28 21:26:48 +0000
commit82c32a8a3fa0c616208e6307b4d3d959da533536 (patch)
tree9ee217684afb0753c0a3a3a7d5180f5bc330dc3e /lib/csu/common
parent24f27bdb948eee33f69437d08daf0617f88ff3d3 (diff)
downloadFreeBSD-src-82c32a8a3fa0c616208e6307b4d3d959da533536.zip
FreeBSD-src-82c32a8a3fa0c616208e6307b4d3d959da533536.tar.gz
* 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.
Diffstat (limited to 'lib/csu/common')
-rw-r--r--lib/csu/common/crtbegin.c19
-rw-r--r--lib/csu/common/crtbrand.c51
2 files changed, 52 insertions, 18 deletions
diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
index 7693d2b..172ee4b 100644
--- a/lib/csu/common/crtbegin.c
+++ b/lib/csu/common/crtbegin.c
@@ -82,21 +82,4 @@ _fini(void)
(*p_do_dtors)();
}
-/*
- * Special ".note" entry specifying the ABI version. See
- * http://www.netbsd.org/Documentation/kernel/elf-notes.html
- * for more information.
- */
-static const struct {
- int32_t namesz;
- int32_t descsz;
- int32_t type;
- char name[sizeof ABI_VENDOR];
- int32_t desc;
-} abitag __attribute__ ((section (ABI_SECTION))) = {
- sizeof ABI_VENDOR,
- sizeof(int32_t),
- ABI_NOTETYPE,
- ABI_VENDOR,
- __FreeBSD_version
-};
+#include "crtbegin.c"
diff --git a/lib/csu/common/crtbrand.c b/lib/csu/common/crtbrand.c
new file mode 100644
index 0000000..aef659a
--- /dev/null
+++ b/lib/csu/common/crtbrand.c
@@ -0,0 +1,51 @@
+/*-
+ * Copyright 1996, 1997, 1998, 2000 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/param.h>
+
+#define ABI_VENDOR "FreeBSD"
+#define ABI_SECTION ".note.ABI-tag"
+#define ABI_NOTETYPE 1
+
+/*
+ * Special ".note" entry specifying the ABI version. See
+ * http://www.netbsd.org/Documentation/kernel/elf-notes.html
+ * for more information.
+ */
+static const struct {
+ int32_t namesz;
+ int32_t descsz;
+ int32_t type;
+ char name[sizeof ABI_VENDOR];
+ int32_t desc;
+} abitag __attribute__ ((section (ABI_SECTION))) = {
+ sizeof ABI_VENDOR,
+ sizeof(int32_t),
+ ABI_NOTETYPE,
+ ABI_VENDOR,
+ __FreeBSD_version
+};
OpenPOWER on IntegriCloud