aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2000-10-28 21:26:48 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2000-10-28 21:26:48 +0000
commitae7c8a2bb8d926e24ef7ccf3a3e091d2d1fbc280 (patch)
tree065fc0c3af84921a89ca9e60f4ce9dbad5891db0 /lib
parent7ca2f6ae1f95016ed6ded5d5b4b68d50288b7714 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/alpha/Makefile8
-rw-r--r--lib/csu/alpha/crt1.c1
-rw-r--r--lib/csu/amd64/Makefile6
-rw-r--r--lib/csu/amd64/crt1.c1
-rw-r--r--lib/csu/amd64/crti.S15
-rw-r--r--lib/csu/amd64/crtn.S9
-rw-r--r--lib/csu/common/crtbegin.c19
-rw-r--r--lib/csu/common/crtbrand.c51
-rw-r--r--lib/csu/i386-elf/Makefile6
-rw-r--r--lib/csu/i386-elf/crt1.c1
-rw-r--r--lib/csu/i386-elf/crti.S15
-rw-r--r--lib/csu/i386-elf/crtn.S9
-rw-r--r--lib/csu/ia64/Makefile1
-rw-r--r--lib/csu/ia64/crt1.c1
14 files changed, 99 insertions, 44 deletions
diff --git a/lib/csu/alpha/Makefile b/lib/csu/alpha/Makefile
index d2155684420a4..519446e85b5d4 100644
--- a/lib/csu/alpha/Makefile
+++ b/lib/csu/alpha/Makefile
@@ -2,11 +2,11 @@
# $FreeBSD$
#
-SRCS= crt1.c crtbegin.c crtend.c
-OBJS= crt1.o crtbegin.o crtend.o
+SRCS= crt1.c
+OBJS= crt1.o
OBJS+= gcrt1.o
-SOBJS= crtbegin.So crtend.So
-CFLAGS+= -Wall -Wno-unused
+CFLAGS+= -Wall -Wno-unused \
+ -I${.CURDIR}/../common
NOMAN= true
NOPIC= true
NOPROFILE= true
diff --git a/lib/csu/alpha/crt1.c b/lib/csu/alpha/crt1.c
index 095effc3a0229..40c08988cc32e 100644
--- a/lib/csu/alpha/crt1.c
+++ b/lib/csu/alpha/crt1.c
@@ -38,6 +38,7 @@
#endif
#include <stdlib.h>
+#include "crtbrand.c"
struct Struct_Obj_Entry;
struct ps_strings;
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index 70e66b16d1658..2082a70500691 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 0ee070227107f..ad1d25f95b819 100644
--- a/lib/csu/amd64/crt1.c
+++ b/lib/csu/amd64/crt1.c
@@ -31,6 +31,7 @@
#include <stddef.h>
#include <stdlib.h>
+#include "crtbrand.c"
typedef void (*fptr)(void);
diff --git a/lib/csu/amd64/crti.S b/lib/csu/amd64/crti.S
index 536d2c243efad..82b262f4dcbe6 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 536d2c243efad..361ab1e2e157f 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
diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
index 7693d2be64ed9..172ee4bafd86b 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 0000000000000..aef659af8d397
--- /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
+};
diff --git a/lib/csu/i386-elf/Makefile b/lib/csu/i386-elf/Makefile
index 70e66b16d1658..2082a70500691 100644
--- a/lib/csu/i386-elf/Makefile
+++ b/lib/csu/i386-elf/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/i386-elf/crt1.c b/lib/csu/i386-elf/crt1.c
index 0ee070227107f..ad1d25f95b819 100644
--- a/lib/csu/i386-elf/crt1.c
+++ b/lib/csu/i386-elf/crt1.c
@@ -31,6 +31,7 @@
#include <stddef.h>
#include <stdlib.h>
+#include "crtbrand.c"
typedef void (*fptr)(void);
diff --git a/lib/csu/i386-elf/crti.S b/lib/csu/i386-elf/crti.S
index 536d2c243efad..82b262f4dcbe6 100644
--- a/lib/csu/i386-elf/crti.S
+++ b/lib/csu/i386-elf/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/i386-elf/crtn.S b/lib/csu/i386-elf/crtn.S
index 536d2c243efad..361ab1e2e157f 100644
--- a/lib/csu/i386-elf/crtn.S
+++ b/lib/csu/i386-elf/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
diff --git a/lib/csu/ia64/Makefile b/lib/csu/ia64/Makefile
index fc988570ed3a4..41c0aa8806b08 100644
--- a/lib/csu/ia64/Makefile
+++ b/lib/csu/ia64/Makefile
@@ -7,6 +7,7 @@ OBJS= crt1.o crtbegin.o crtend.o
OBJS+= gcrt1.o
SOBJS= crtbegin.So crtend.So
CFLAGS+= -Wall -Wno-unused
+CFLAGS+= -I${.CURDIR}/../common
NOMAN= true
NOPIC= true
NOPROFILE= true
diff --git a/lib/csu/ia64/crt1.c b/lib/csu/ia64/crt1.c
index 8fa06ba642573..4f5923339e8ee 100644
--- a/lib/csu/ia64/crt1.c
+++ b/lib/csu/ia64/crt1.c
@@ -38,6 +38,7 @@
#endif
#include <stdlib.h>
+#include "crtbrand.c"
struct Struct_Obj_Entry;
struct ps_strings;