summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2014-04-16 20:03:15 +0100
committerRichard Lowe <richlowe@richlowe.net>2017-10-02 15:55:19 -0400
commit3e76f9d6851ef6c63217178eb67278ec2809b944 (patch)
tree8c8e1172a6bdbce8420f12d2af84d19f658bbae1 /usr/src
parent2aca6c63d5cd09b4015887c19fcacf9df90967b0 (diff)
downloadillumos-joyent-3e76f9d6851ef6c63217178eb67278ec2809b944.tar.gz
8609 want a position independent CRT
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Albert Lee <trisk@forkgnu.org> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/awk_xpg4/Makefile4
-rw-r--r--usr/src/cmd/awk_xpg4/inc.flg30
-rw-r--r--usr/src/cmd/cron/Makefile4
-rw-r--r--usr/src/cmd/cron/inc.flg31
-rw-r--r--usr/src/cmd/date/Makefile6
-rw-r--r--usr/src/cmd/date/inc.flg30
-rw-r--r--usr/src/cmd/ed/Makefile8
-rw-r--r--usr/src/cmd/ed/inc.flg3
-rw-r--r--usr/src/cmd/env/Makefile6
-rw-r--r--usr/src/cmd/env/inc.flg30
-rw-r--r--usr/src/cmd/getconf/Makefile4
-rw-r--r--usr/src/cmd/getconf/inc.flg31
-rw-r--r--usr/src/cmd/link/Makefile4
-rw-r--r--usr/src/cmd/link/inc.flg30
-rw-r--r--usr/src/cmd/mv/Makefile4
-rw-r--r--usr/src/cmd/mv/inc.flg31
-rw-r--r--usr/src/cmd/nice/Makefile6
-rw-r--r--usr/src/cmd/nice/inc.flg30
-rw-r--r--usr/src/cmd/sgs/0@0/Makefile.com1
-rw-r--r--usr/src/cmd/sgs/0@0/amd64/Makefile4
-rw-r--r--usr/src/cmd/sgs/0@0/i386/Makefile3
-rw-r--r--usr/src/cmd/sgs/0@0/sparc/Makefile3
-rw-r--r--usr/src/cmd/sgs/0@0/sparcv9/Makefile3
-rw-r--r--usr/src/cmd/sgs/rtld/amd64/Makefile2
-rw-r--r--usr/src/cmd/sgs/rtld/i386/Makefile2
-rw-r--r--usr/src/cmd/sgs/rtld/sparc/Makefile2
-rw-r--r--usr/src/cmd/sgs/rtld/sparcv9/Makefile2
-rw-r--r--usr/src/cmd/vi/port/Makefile8
-rw-r--r--usr/src/cmd/vi/port/inc.flg6
-rw-r--r--usr/src/lib/Makefile6
-rw-r--r--usr/src/lib/common/amd64/crt1.s192
-rw-r--r--usr/src/lib/common/amd64/gcrt1.s191
-rw-r--r--usr/src/lib/common/i386/crt1.s216
-rw-r--r--usr/src/lib/common/i386/gcrt1.s206
-rw-r--r--usr/src/lib/common/sparc/crti.s60
-rw-r--r--usr/src/lib/common/sparc/crtn.s54
-rw-r--r--usr/src/lib/crt/Makefile (renamed from usr/src/lib/common/Makefile)7
-rw-r--r--usr/src/lib/crt/Makefile.com (renamed from usr/src/lib/common/Makefile.com)41
-rw-r--r--usr/src/lib/crt/amd64/Makefile (renamed from usr/src/lib/common/amd64/Makefile)2
-rw-r--r--usr/src/lib/crt/amd64/crti.s (renamed from usr/src/lib/common/amd64/crti.s)2
-rw-r--r--usr/src/lib/crt/amd64/crtn.s (renamed from usr/src/lib/common/amd64/crtn.s)0
-rw-r--r--usr/src/lib/crt/amd64/mach-crt1.s98
-rw-r--r--usr/src/lib/crt/common/common-crt.c100
-rw-r--r--usr/src/lib/crt/common/values-Xa.c (renamed from usr/src/lib/common/common/values-Xa.c)2
-rw-r--r--usr/src/lib/crt/common/values-Xc.c (renamed from usr/src/lib/common/common/values-Xc.c)2
-rw-r--r--usr/src/lib/crt/common/values-Xs.c (renamed from usr/src/lib/common/common/values-Xs.c)2
-rw-r--r--usr/src/lib/crt/common/values-Xt.c (renamed from usr/src/lib/common/common/values-Xt.c)2
-rw-r--r--usr/src/lib/crt/common/values-xpg4.c (renamed from usr/src/lib/common/common/values-xpg4.c)2
-rw-r--r--usr/src/lib/crt/common/values-xpg6.c (renamed from usr/src/lib/common/common/values-xpg6.c)2
-rw-r--r--usr/src/lib/crt/i386/Makefile (renamed from usr/src/lib/common/i386/Makefile)2
-rw-r--r--usr/src/lib/crt/i386/crti.s (renamed from usr/src/lib/common/i386/crti.s)2
-rw-r--r--usr/src/lib/crt/i386/crtn.s (renamed from usr/src/lib/common/i386/crtn.s)1
-rw-r--r--usr/src/lib/crt/i386/fsr.s (renamed from usr/src/lib/common/i386/fsr.s)33
-rw-r--r--usr/src/lib/crt/i386/mach-crt1.s80
-rw-r--r--usr/src/lib/crt/sparc/Makefile (renamed from usr/src/lib/common/sparc/Makefile)2
-rw-r--r--usr/src/lib/crt/sparc/crti.s (renamed from usr/src/lib/common/sparcv9/crti.s)0
-rw-r--r--usr/src/lib/crt/sparc/crtn.s (renamed from usr/src/lib/common/sparcv9/crtn.s)0
-rw-r--r--usr/src/lib/crt/sparc/mach-crt1.s75
-rw-r--r--usr/src/lib/crt/sparcv9/Makefile (renamed from usr/src/lib/common/sparcv9/Makefile)2
-rw-r--r--usr/src/lib/libc/Makefile.targ2
-rw-r--r--usr/src/lib/libc/amd64/Makefile4
-rw-r--r--usr/src/lib/libc/i386/Makefile.com4
-rw-r--r--usr/src/lib/libc/i386/gen/makectxt.c4
-rw-r--r--usr/src/lib/libc/i386/threads/machdep.c14
-rw-r--r--usr/src/lib/libc/req.flg2
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com4
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com4
-rw-r--r--usr/src/lib/libc_db/amd64/Makefile4
-rw-r--r--usr/src/lib/libc_db/i386/Makefile4
-rw-r--r--usr/src/lib/libc_db/sparc/Makefile4
-rw-r--r--usr/src/lib/libc_db/sparcv9/Makefile4
-rw-r--r--usr/src/lib/libnsl/Makefile.com2
-rw-r--r--usr/src/lib/req.flg4
-rw-r--r--usr/src/pkg/manifests/developer-library-lint.mf43
-rw-r--r--usr/src/pkg/manifests/system-library-c-runtime.mf57
75 files changed, 523 insertions, 1349 deletions
diff --git a/usr/src/cmd/awk_xpg4/Makefile b/usr/src/cmd/awk_xpg4/Makefile
index 79a85e8d04..dce7e2639c 100644
--- a/usr/src/cmd/awk_xpg4/Makefile
+++ b/usr/src/cmd/awk_xpg4/Makefile
@@ -70,8 +70,8 @@ $(POFILE): $(POFILES)
install: all $(ROOTXPG4PROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
$(RM) $(OBJS) $(XPG4) $(CLEANFILES)
diff --git a/usr/src/cmd/awk_xpg4/inc.flg b/usr/src/cmd/awk_xpg4/inc.flg
deleted file mode 100644
index 712c9e4f8f..0000000000
--- a/usr/src/cmd/awk_xpg4/inc.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile
index c9ffeadffe..2875e0dece 100644
--- a/usr/src/cmd/cron/Makefile
+++ b/usr/src/cmd/cron/Makefile
@@ -181,8 +181,8 @@ objs.xpg4/%.o: %.c
objs.xpg4:
-@mkdir -p $@
-objs.xpg4/values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+objs.xpg4/values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
%.o: $(SRC)/common/util/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
diff --git a/usr/src/cmd/cron/inc.flg b/usr/src/cmd/cron/inc.flg
deleted file mode 100644
index 8937cbf632..0000000000
--- a/usr/src/cmd/cron/inc.flg
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/common/util/getresponse.c
-echo_file usr/src/common/util/getresponse.h
diff --git a/usr/src/cmd/date/Makefile b/usr/src/cmd/date/Makefile
index f57b45a786..ff0668f4fc 100644
--- a/usr/src/cmd/date/Makefile
+++ b/usr/src/cmd/date/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -48,8 +46,8 @@ $(PROG) $(XPG4): $$(OBJS)
install: all $(ROOTPROG) $(ROOTXPG4PROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
$(RM) $(OBJS)
diff --git a/usr/src/cmd/date/inc.flg b/usr/src/cmd/date/inc.flg
deleted file mode 100644
index c6243d6fe9..0000000000
--- a/usr/src/cmd/date/inc.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
diff --git a/usr/src/cmd/ed/Makefile b/usr/src/cmd/ed/Makefile
index a5f6cef95a..b6737d8978 100644
--- a/usr/src/cmd/ed/Makefile
+++ b/usr/src/cmd/ed/Makefile
@@ -103,11 +103,11 @@ install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
$(RM) $(ROOTBIN)/red
$(LN) $(ROOTBIN)/ed $(ROOTBIN)/red
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
-values-xpg6.o: ../../lib/common/common/values-xpg6.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg6.c
+values-xpg6.o: ../../lib/crt/common/values-xpg6.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg6.c
clean:
-@rm -rf $(OBJS) $(XPG4) $(XPG6) edobjs.xpg4 edobjs.xpg6 \
diff --git a/usr/src/cmd/ed/inc.flg b/usr/src/cmd/ed/inc.flg
index 156b53e845..98371166b4 100644
--- a/usr/src/cmd/ed/inc.flg
+++ b/usr/src/cmd/ed/inc.flg
@@ -24,9 +24,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
echo_file usr/src/cmd/expr/compile.c
echo_file usr/src/cmd/expr/mapfile-intf
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
diff --git a/usr/src/cmd/env/Makefile b/usr/src/cmd/env/Makefile
index f1614d1cb4..1ebadb08e5 100644
--- a/usr/src/cmd/env/Makefile
+++ b/usr/src/cmd/env/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= env
XPG4PROG= env
@@ -44,8 +42,8 @@ $(PROG) $(XPG4): $$(OBJS)
install: all $(ROOTPROG) $(ROOTXPG4PROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
$(RM) $(OBJS)
diff --git a/usr/src/cmd/env/inc.flg b/usr/src/cmd/env/inc.flg
deleted file mode 100644
index c6243d6fe9..0000000000
--- a/usr/src/cmd/env/inc.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
diff --git a/usr/src/cmd/getconf/Makefile b/usr/src/cmd/getconf/Makefile
index cd001490d8..6293596e58 100644
--- a/usr/src/cmd/getconf/Makefile
+++ b/usr/src/cmd/getconf/Makefile
@@ -111,8 +111,8 @@ $(X6):
install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
-@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \
diff --git a/usr/src/cmd/getconf/inc.flg b/usr/src/cmd/getconf/inc.flg
deleted file mode 100644
index b66199dafe..0000000000
--- a/usr/src/cmd/getconf/inc.flg
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
diff --git a/usr/src/cmd/link/Makefile b/usr/src/cmd/link/Makefile
index f8c8eaaa95..34724bf288 100644
--- a/usr/src/cmd/link/Makefile
+++ b/usr/src/cmd/link/Makefile
@@ -50,8 +50,8 @@ install: all $(ROOTUSRSBINPROG) $(ROOTXPG4PROG)
-$(RM) $(ROOTETCPROG)
-$(SYMLINK) ../usr/sbin/$(PROG) $(ROOTETCPROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
$(RM) $(OBJS)
diff --git a/usr/src/cmd/link/inc.flg b/usr/src/cmd/link/inc.flg
deleted file mode 100644
index c6243d6fe9..0000000000
--- a/usr/src/cmd/link/inc.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
diff --git a/usr/src/cmd/mv/Makefile b/usr/src/cmd/mv/Makefile
index 2072612ffe..5e866b5bbf 100644
--- a/usr/src/cmd/mv/Makefile
+++ b/usr/src/cmd/mv/Makefile
@@ -76,8 +76,8 @@ xpg4_%.o: $(SRC)/common/util/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-%values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+%values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
$(CPFILE): $(PROG)
@$(RM) $(CPFILE); $(LN) $(PROG) $(CPFILE)
diff --git a/usr/src/cmd/mv/inc.flg b/usr/src/cmd/mv/inc.flg
deleted file mode 100644
index 8937cbf632..0000000000
--- a/usr/src/cmd/mv/inc.flg
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/common/util/getresponse.c
-echo_file usr/src/common/util/getresponse.h
diff --git a/usr/src/cmd/nice/Makefile b/usr/src/cmd/nice/Makefile
index 4f29f44988..c9d56309fa 100644
--- a/usr/src/cmd/nice/Makefile
+++ b/usr/src/cmd/nice/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= nice
XPG4PROG= nice
@@ -45,8 +43,8 @@ $(PROG) $(XPG4): $$(OBJS)
install: all $(ROOTPROG) $(ROOTXPG4PROG)
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
clean:
$(RM) $(OBJS)
diff --git a/usr/src/cmd/nice/inc.flg b/usr/src/cmd/nice/inc.flg
deleted file mode 100644
index c6243d6fe9..0000000000
--- a/usr/src/cmd/nice/inc.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
diff --git a/usr/src/cmd/sgs/0@0/Makefile.com b/usr/src/cmd/sgs/0@0/Makefile.com
index 6d0dc93fb1..cb8aba4043 100644
--- a/usr/src/cmd/sgs/0@0/Makefile.com
+++ b/usr/src/cmd/sgs/0@0/Makefile.com
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
#
LIBRARY= 0@0.a
diff --git a/usr/src/cmd/sgs/0@0/amd64/Makefile b/usr/src/cmd/sgs/0@0/amd64/Makefile
index cf2c5a388f..fb7b09985f 100644
--- a/usr/src/cmd/sgs/0@0/amd64/Makefile
+++ b/usr/src/cmd/sgs/0@0/amd64/Makefile
@@ -23,10 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-CRTSRCS = $(SRC)/lib/common/amd64
+CRTSRCS = $(SRC)/lib/crt/amd64
include $(SRC)/cmd/sgs/0@0/Makefile.com
diff --git a/usr/src/cmd/sgs/0@0/i386/Makefile b/usr/src/cmd/sgs/0@0/i386/Makefile
index 0b73f7c16d..9d092d3ad2 100644
--- a/usr/src/cmd/sgs/0@0/i386/Makefile
+++ b/usr/src/cmd/sgs/0@0/i386/Makefile
@@ -23,9 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-CRTSRCS= $(SRC)/lib/common/i386
+CRTSRCS= $(SRC)/lib/crt/i386
include $(SRC)/cmd/sgs/0@0/Makefile.com
.KEEP_STATE:
diff --git a/usr/src/cmd/sgs/0@0/sparc/Makefile b/usr/src/cmd/sgs/0@0/sparc/Makefile
index c4a49d4eb7..87b206c9fb 100644
--- a/usr/src/cmd/sgs/0@0/sparc/Makefile
+++ b/usr/src/cmd/sgs/0@0/sparc/Makefile
@@ -23,9 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-CRTSRCS= $(SRC)/lib/common/sparc
+CRTSRCS= $(SRC)/lib/crt/sparc
include $(SRC)/cmd/sgs/0@0/Makefile.com
diff --git a/usr/src/cmd/sgs/0@0/sparcv9/Makefile b/usr/src/cmd/sgs/0@0/sparcv9/Makefile
index bdc39aaa44..1c04727d06 100644
--- a/usr/src/cmd/sgs/0@0/sparcv9/Makefile
+++ b/usr/src/cmd/sgs/0@0/sparcv9/Makefile
@@ -23,9 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-CRTSRCS= $(SRC)/lib/common/sparcv9
+CRTSRCS= $(SRC)/lib/crt/sparc
include $(SRC)/cmd/sgs/0@0/Makefile.com
.KEEP_STATE:
diff --git a/usr/src/cmd/sgs/rtld/amd64/Makefile b/usr/src/cmd/sgs/rtld/amd64/Makefile
index 053171045d..b6db892ba6 100644
--- a/usr/src/cmd/sgs/rtld/amd64/Makefile
+++ b/usr/src/cmd/sgs/rtld/amd64/Makefile
@@ -48,7 +48,7 @@ P_ASOBJS= boot.o boot_elf.o caller.o
S_ASOBJS=
-CRTSRCS= ../../../../lib/common/amd64
+CRTSRCS= ../../../../lib/crt/amd64
CRTI= pics/crti.o
CRTN= pics/crtn.o
CRTS= $(CRTI) $(CRTN)
diff --git a/usr/src/cmd/sgs/rtld/i386/Makefile b/usr/src/cmd/sgs/rtld/i386/Makefile
index 043d38b99a..40ec3f44af 100644
--- a/usr/src/cmd/sgs/rtld/i386/Makefile
+++ b/usr/src/cmd/sgs/rtld/i386/Makefile
@@ -48,7 +48,7 @@ P_ASOBJS= boot.o boot_elf.o caller.o
S_ASOBJS=
-CRTSRCS= ../../../../lib/common/i386
+CRTSRCS= ../../../../lib/crt/i386
CRTI= pics/crti.o
CRTN= pics/crtn.o
CRTS= $(CRTI) $(CRTN)
diff --git a/usr/src/cmd/sgs/rtld/sparc/Makefile b/usr/src/cmd/sgs/rtld/sparc/Makefile
index d142ee2241..d2630c52db 100644
--- a/usr/src/cmd/sgs/rtld/sparc/Makefile
+++ b/usr/src/cmd/sgs/rtld/sparc/Makefile
@@ -47,7 +47,7 @@ P_ASOBJS= boot.o boot_elf.o caller.o
S_ASOBJS= boot_a.out.o
-CRTSRCS= ../../../../lib/common/sparc
+CRTSRCS= ../../../../lib/crt/sparc
CRTI= pics/crti.o
CRTN= pics/crtn.o
CRTS= $(CRTI) $(CRTN)
diff --git a/usr/src/cmd/sgs/rtld/sparcv9/Makefile b/usr/src/cmd/sgs/rtld/sparcv9/Makefile
index eafc1b0022..0093a7b86e 100644
--- a/usr/src/cmd/sgs/rtld/sparcv9/Makefile
+++ b/usr/src/cmd/sgs/rtld/sparcv9/Makefile
@@ -46,7 +46,7 @@ P_ASOBJS= boot.o boot_elf.o caller.o
S_ASOBJS=
-CRTSRCS= ../../../../lib/common/sparcv9
+CRTSRCS= ../../../../lib/crt/sparc
CRTI= pics/crti.o
CRTN= pics/crtn.o
CRTS= $(CRTI) $(CRTN)
diff --git a/usr/src/cmd/vi/port/Makefile b/usr/src/cmd/vi/port/Makefile
index 268dd752a6..eb22a5e54e 100644
--- a/usr/src/cmd/vi/port/Makefile
+++ b/usr/src/cmd/vi/port/Makefile
@@ -117,11 +117,11 @@ ex.xpg6: $(XD6) $(XPG6EXOBJS)
$(XD4)/compile.o $(XD6)/compile.o: ../../expr/compile.c
$(COMPILE.c) -o $@ ../../expr/compile.c
-%values-xpg4.o: ../../../lib/common/common/values-xpg4.c
- $(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg4.c
+%values-xpg4.o: ../../../lib/crt/common/values-xpg4.c
+ $(COMPILE.c) -o $@ ../../../lib/crt/common/values-xpg4.c
-%values-xpg6.o: ../../../lib/common/common/values-xpg6.c
- $(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg6.c
+%values-xpg6.o: ../../../lib/crt/common/values-xpg6.c
+ $(COMPILE.c) -o $@ ../../../lib/crt/common/values-xpg6.c
$(XPG4EXOBJS): $(XD4)
diff --git a/usr/src/cmd/vi/port/inc.flg b/usr/src/cmd/vi/port/inc.flg
index a9d2688f76..1c7a8cacb2 100644
--- a/usr/src/cmd/vi/port/inc.flg
+++ b/usr/src/cmd/vi/port/inc.flg
@@ -24,10 +24,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
echo_file usr/src/cmd/expr/compile.c
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
-echo_file usr/src/lib/libc/inc/xpg6.h
+
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index debd9cd0e4..d72fdba6b3 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -44,7 +44,7 @@ include ../Makefile.master
# Build libc and its dependencies
SUBDIRS= \
- common \
+ crt \
../cmd/sgs/libconv \
../cmd/sgs/libdl \
libc \
@@ -549,8 +549,8 @@ _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
_dc: $(DCSUBDIRS:%=%-nodepend)
# Library interdependencies are called out explicitly here.
-../cmd/sgs/libconv: common
-../cmd/sgs/libdl: common
+../cmd/sgs/libconv: crt
+../cmd/sgs/libdl: crt
libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
libm: libc
diff --git a/usr/src/lib/common/amd64/crt1.s b/usr/src/lib/common/amd64/crt1.s
deleted file mode 100644
index 2d3cd220ce..0000000000
--- a/usr/src/lib/common/amd64/crt1.s
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build
- * a 64-bit executable with gcc. It is installed in /usr/lib/amd64
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
- .ident "%Z%%M% %I% %E% SMI"
-
- .file "crt1.s"
-
- .globl _start
-
-/* global entities defined elsewhere but used here */
- .globl main
- .globl __fpstart
- .globl exit
- .globl _exit
- .weak _DYNAMIC
-
- .section .data
-
- .weak environ
- .set environ,_environ
- .globl _environ
- .type _environ,@object
- .size _environ,8
- .align 8
-_environ:
- .8byte 0x0
-
- .globl __environ_lock
- .type __environ_lock,@object
- .size __environ_lock,24
- .align 8
-__environ_lock:
- .zero 24
-
- .globl ___Argv
- .type ___Argv,@object
- .size ___Argv,8
- .align 8
-___Argv:
- .8byte 0x0
-
- .section .text
- .align 8
-
-/*
- * The SVR4/i386 ABI (pages 3-29) says that when the entry
- * point runs registers' %rbp, %rsp, %rdx values are specified
- * the following:
- *
- * %rbp The content of this register is unspecified at
- * process initialization time, but the user code should mark
- * the deepest stack frame by setting the frame pointer to zero.
- * No other frame's %ebp should have a zero value.
- *
- * %rsp Performing its usual job, the stack pointer holds the address
- * of the bottom of the stack, which is guaranteed to be
- * quadword aligned.
- *
- * The stack contains the arguments and environment:
- * ...
- * envp[0] (16+(8*argc))(%rsp)
- * NULL (8+(8*argc))(%rsp)
- * ...
- * argv[0] 8(%rsp)
- * argc 0(%rsp)
- *
- * %rdx In a conforming program, this register contains a function
- * pointer that the application should register with atexit(BA_OS).
- * This function is used for shared object termination code
- * [see Dynamic Linking in Chapter 5 of the System V ABI].
- *
- */
-
- .type _start,@function
-_start:
-/*
- * Allocate a NULL return address and a NULL previous %rbp as if
- * there was a genuine call to _start.
- */
- pushq $0
- pushq $0
- movq %rsp,%rbp /* The first stack frame */
-
-/*
- * The stack now is
- *
- * envp[0] (32+(8*argc))(%rsp) - (A)
- * NULL (24+(8*argc))(%rsp)
- * ...
- * argv[0] 24(%rbp) - (B)
- * argc 16(%rbp)
- * 0 8(%rbp)
- * 0 0(%rbp)
- */
-
- movq $_DYNAMIC,%rax
- testq %rax,%rax
- jz 1f
- movq %rdx,%rdi /* register rt_do_exit */
- call atexit
-1:
- movq $_fini,%rdi
- call atexit
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
- movq 16(%rbp),%rax /* argc */
- movq _environ, %rcx
- testq %rcx, %rcx /* check if _environ==0 */
- jne 1f
- leaq 32(%rbp,%rax,8),%rcx /* (A) */
- movq %rcx,_environ /* copy to _environ */
-1:
-
-/*
- * Force stack alignment - below here there must have been an even
- * number of un-popped pushq instructions whenever a call is reached
- */
- andq $-16,%rsp
- pushq %rdx
- leaq 24(%rbp),%rdx /* argv (B) */
- movq %rdx,___Argv
- pushq %rcx
- pushq %rdx
- pushq %rax
- call __fpstart
- call _init
- popq %rdi
- popq %rsi
- popq %rdx
- popq %rcx
- call main /* main(argc,argv,envp) */
- pushq %rax
- pushq %rax
- movq %rax,%rdi /* and call exit */
- call exit
- popq %rdi
- popq %rdi
- call _exit /* if user redefined exit, call _exit */
- hlt
- .size _start, .-_start
-
-/*
- * The following is here in case any object module compiled with cc -p
- * was linked into this module.
- */
- .globl _mcount
- .section .text
- .align 8
- .type _mcount,@function
-_mcount:
- ret
- .size _mcount, .-_mcount
-
- .globl __longdouble_used
- .section .data
- .align 8
- .type __longdouble_used,@object
- .size __longdouble_used,4
-__longdouble_used:
- .4byte 0
diff --git a/usr/src/lib/common/amd64/gcrt1.s b/usr/src/lib/common/amd64/gcrt1.s
deleted file mode 100644
index 338fd2deff..0000000000
--- a/usr/src/lib/common/amd64/gcrt1.s
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build a
- * 64-bit progile executable with gcc -pg. It is installed in /usr/lib/amd64
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
- .ident "%Z%%M% %I% %E% SMI"
-
- .file "gcrt1.s"
-
- .globl _start
- .globl _etext
-
-/* global entities defined elsewhere but used here */
- .globl main
- .globl __fpstart
- .globl _init
- .globl _fini
- .globl exit
- .globl _exit
- .globl monstartup
- .weak _mcleanup
- .weak _DYNAMIC
-
- .section .data
-
- .weak environ
- .set environ,_environ
- .globl _environ
- .type _environ,@object
- .size _environ,8
- .align 8
-_environ:
- .8byte 0x0
-
- .globl ___Argv
- .type ___Argv,@object
- .size ___Argv,8
- .align 8
-___Argv:
- .8byte 0x0
-
- .section .text
- .align 8
-
-/*
- * The SVR4/i386 ABI (pages 3-29) says that when the entry
- * point runs registers' %rbp, %rsp, %rdx values are specified
- * the following:
- *
- * %rbp The content of this register is unspecified at
- * process initialization time, but the user code should mark
- * the deepest stack frame by setting the frame pointer to zero.
- * No other frame's %ebp should have a zero value.
- *
- * %rsp Performing its usual job, the stack pointer holds the address
- * of the bottom of the stack, which is guaranteed to be
- * quadword aligned.
- *
- * The stack contains the arguments and environment:
- * ...
- * envp[0] (16+(8*argc))(%rsp)
- * NULL (8+(8*argc))(%rsp)
- * ...
- * argv[0] 8(%rsp)
- * argc 0(%rsp)
- *
- * %rdx In a conforming program, this register contains a function
- * pointer that the application should register with atexit(BA_OS).
- * This function is used for shared object termination code
- * [see Dynamic Linking in Chapter 5 of the System V ABI].
- *
- */
-
- .type _start,@function
-_start:
-/*
- * Allocate a NULL return address and a NULL previous %rbp as if
- * there was a genuine call to _start.
- */
- pushq $0
- pushq $0
- movq %rsp,%rbp /* The first stack frame */
-
-/*
- * The stack now is
- *
- * envp[0] (32+(8*argc))(%rsp) - (A)
- * NULL (24+(8*argc))(%rsp)
- * ...
- * argv[0] 24(%rbp) - (B)
- * argc 16(%rbp)
- * 0 8(%rbp)
- * 0 0(%rbp)
- */
-
-/*
- * Check to see if there is an _mcleanup() function linked in, and if so,
- * register it with atexit() as the last thing to be run by exit().
- */
- movq %rdx,%r12 /* save rt_do_exit for later atexit */
-
- movq $_mcleanup,%rdi
- testq %rdi,%rdi
- jz 1f
- call atexit
-1:
-
- movq $_DYNAMIC,%rax
- testq %rax,%rax
- jz 1f
- movq %r12,%rdi /* register rt_do_exit */
- call atexit
-1:
-
- movq $_fini,%rdi
- call atexit
-
-/* start profiling */
- pushq %rbp
- movq %rsp,%rbp
- movq $_start,%rdi
- movq $_etext,%rsi
- call monstartup
- popq %rbp
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
- movq 16(%rbp),%rax /* argc */
- movq _environ, %rcx
- testq %rcx, %rcx /* check if _environ==0 */
- jne 1f
- leaq 32(%rbp,%rax,8),%rcx /* (A) */
- movq %rcx,_environ /* copy to _environ */
-1:
-
-/*
- * Force stack alignment - below here there must have been an even
- * number of un-popped pushq instructions whenever a call is reached
- */
- andq $-16,%rsp
- pushq %rdx
- leaq 24(%rbp),%rdx /* argv (B) */
- movq %rdx,___Argv
- pushq %rcx
- pushq %rdx
- pushq %rax
- call __fpstart
- call _init
- popq %rdi
- popq %rsi
- popq %rdx
- popq %rcx
- call main /* main(argc,argv,envp) */
- pushq %rax
- pushq %rax
- movq %rax,%rdi /* and call exit */
- call exit
- popq %rdi
- popq %rdi
- call _exit /* if user redefined exit, call _exit */
- hlt
- .size _start, .-_start
diff --git a/usr/src/lib/common/i386/crt1.s b/usr/src/lib/common/i386/crt1.s
deleted file mode 100644
index 0fe2cb816e..0000000000
--- a/usr/src/lib/common/i386/crt1.s
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build
- * a 32-bit executable with gcc. It is installed in /usr/lib
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
- .file "crt1.s"
-
- .globl _start
-
-/* global entities defined elsewhere but used here */
- .globl main
- .globl __fpstart
- .globl exit
- .globl _exit
- .weak _DYNAMIC
-
- .section .data
-
- .weak environ
- .set environ,_environ
- .globl _environ
- .type _environ,@object
- .size _environ,4
- .align 4
-_environ:
- .4byte 0x0
-
- .globl __environ_lock
- .type __environ_lock,@object
- .size __environ_lock,24
- .align 8
-__environ_lock:
- .zero 24
-
- .globl ___Argv
- .type ___Argv,@object
- .size ___Argv,4
- .align 4
-___Argv:
- .4byte 0x0
-
- .section .text
- .align 4
-
-/*
- * C language startup routine.
- * Assume that exec code has cleared the direction flag in the TSS.
- * Assume that %esp is set to the addr after the last word pushed.
- * The stack contains (in order): argc, argv[],envp[],...
- * Assume that all of the segment registers are initialized.
- *
- * Allocate a NULL return address and a NULL previous %ebp as if
- * there was a genuine call to _start.
- * sdb stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
- */
- .type _start,@function
-_start:
- pushl $0
- pushl $0
- movl %esp,%ebp /* The first stack frame */
-
- movl $_DYNAMIC,%eax
- testl %eax,%eax
- jz 1f
- pushl %edx /* register rt_do_exit */
- call atexit
- addl $4,%esp
-1:
- pushl $_fini
- call atexit
- addl $4,%esp
-
-/*
- * The following code provides almost standard static destructor handling
- * for systems that do not have the modified atexit processing in their
- * system libraries. It checks for the existence of the new routine
- * "_get_exit_frame_monitor()", which is in libc.so when the new exit-handling
- * code is there. It then check for the existence of "__Crun::do_exit_code()"
- * which will be in libCrun.so whenever the code was linked with the C++
- * compiler. If there is no enhanced atexit, and we do have do_exit_code,
- * we register the latter with atexit. There are 5 extra slots in
- * atexit, so this will still be standard conforming. Since the code
- * is registered after the .fini section, it runs before the library
- * cleanup code, leaving nothing for the calls to _do_exit_code_in_range
- * to handle.
- *
- * Remove this code and the associated code in libCrun when the earliest
- * system to be supported is Solaris 8.
- */
- .weak _get_exit_frame_monitor
- .weak __1cG__CrunMdo_exit_code6F_v_
-
- .section .data
- .align 4
-__get_exit_frame_monitor_ptr:
- .4byte _get_exit_frame_monitor
- .type __get_exit_frame_monitor_ptr,@object
- .size __get_exit_frame_monitor_ptr,4
-
- .align 4
-__do_exit_code_ptr:
- .4byte __1cG__CrunMdo_exit_code6F_v_
- .type __do_exit_code_ptr,@object
- .size __do_exit_code_ptr,4
-
- .section .text
-
- lea __get_exit_frame_monitor_ptr, %eax
- movl (%eax), %eax
- testl %eax,%eax
- jz 1f
- lea __do_exit_code_ptr, %eax
- movl (%eax), %eax
- testl %eax, %eax
- jz 1f
- pushl %eax
- call atexit /* atexit(__Crun::do_exit_code()) */
- addl $4,%esp
-1:
-
-/*
- * End of destructor handling code
- */
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-
- movl 8(%ebp),%eax /* argc */
- movl _environ, %edx /* fixed bug 4302802 */
- testl %edx, %edx /* check if _enviorn==0 */
- jne 1f /* fixed bug 4203802 */
- leal 16(%ebp,%eax,4),%edx /* envp */
- movl %edx,_environ /* copy to _environ */
-1:
- /*
- * The stack needs to be 16-byte aligned with a 4-byte bias. See
- * comment in lib/libc/i386/gen/makectxt.c.
- *
- * Note: If you change it, you need to change it in the following
- * files as well:
- *
- * - lib/libc/i386/threads/machdep.c
- * - lib/libc/i386/gen/makectxt.c
- * - lib/common/i386/crti.s
- */
- andl $-16,%esp /* make main() and exit() be called with */
- subl $4,%esp /* a properly aligned stack pointer */
- pushl %edx
- leal 12(%ebp),%edx /* argv */
- movl %edx,___Argv
- pushl %edx
- pushl %eax /* argc */
- call __fpstart
- call __fsr /* support for ftrap/fround/fprecision */
- call _init
- call main /* main(argc,argv,envp) */
- movl %eax,(%esp) /* return value from main, for exit() */
- movl %eax,4(%esp) /* remember it for _exit(), below */
- call exit
- movl 4(%esp),%eax /* if user redefined exit, call _exit */
- movl %eax,(%esp)
- call _exit
- hlt
- .size _start, .-_start
-
-#include "fsr.s"
-
-/*
- * The following is here in case any object module compiled with cc -p
- * was linked into this module.
- */
- .section .text
- .align 4
- .globl _mcount
- .type _mcount,@function
-_mcount:
- ret
- .size _mcount, .-_mcount
-
- .section .data
-
- .globl __longdouble_used
- .type __longdouble_used,@object
- .size __longdouble_used,4
- .align 4
-__longdouble_used:
- .4byte 0x0
diff --git a/usr/src/lib/common/i386/gcrt1.s b/usr/src/lib/common/i386/gcrt1.s
deleted file mode 100644
index 71f807397a..0000000000
--- a/usr/src/lib/common/i386/gcrt1.s
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * This gcrt1.o module is provided as the bare minimum required to build a
- * 32-bit profile executable with gcc -pg. It is installed in /usr/lib
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
- .ident "%Z%%M% %I% %E% SMI"
-
- .file "gcrt1.s"
-
- .globl _start
- .globl _etext
-
-/* global entities defined elsewhere but used here */
- .globl main
- .globl __fpstart
- .globl _init
- .globl _fini
- .globl exit
- .globl _exit
- .globl monstartup
- .weak _mcleanup
- .weak _DYNAMIC
-
- .section .data
-
- .weak environ
- .set environ,_environ
- .globl _environ
- .type _environ,@object
- .size _environ,4
- .align 4
-_environ:
- .4byte 0x0
-
- .globl ___Argv
- .type ___Argv,@object
- .size ___Argv,4
- .align 4
-___Argv:
- .4byte 0x0
-
- .section .text
- .align 4
-
-/*
- * C language startup routine.
- * Assume that exec code has cleared the direction flag in the TSS.
- * Assume that %esp is set to the addr after the last word pushed.
- * The stack contains (in order): argc, argv[],envp[],...
- * Assume that all of the segment registers are initialized.
- *
- * Allocate a NULL return address and a NULL previous %ebp as if
- * there was a genuine call to _start.
- * sdb stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
- */
- .type _start,@function
-_start:
- pushl $0
- pushl $0
- movl %esp,%ebp /* The first stack frame */
-
-/*
- * Check to see if there is an _mcleanup() function linked in, and if so,
- * register it with atexit() as the last thing to be run by exit().
- */
- pushl %edx /* save rt_do_exit for later atexit */
-
- movl $_mcleanup,%eax
- testl %eax,%eax
- jz 1f
- pushl %eax
- call atexit
- addl $4,%esp
-1:
-
- movl $_DYNAMIC,%eax
- testl %eax,%eax
- jz 1f
- call atexit /* register rt_do_exit */
-1:
- addl $4,%esp
-
- pushl $_fini
- call atexit
- addl $4,%esp
-
-/* start profiling */
- pushl %ebp
- movl %esp,%ebp
- pushl $_etext
- pushl $_start
- call monstartup
- addl $8,%esp
- popl %ebp
-
-/*
- * The following code provides almost standard static destructor handling
- * for systems that do not have the modified atexit processing in their
- * system libraries. It checks for the existence of the new routine
- * "_get_exit_frame_monitor()", which is in libc.so when the new exit-handling
- * code is there. It then check for the existence of "__Crun::do_exit_code()"
- * which will be in libCrun.so whenever the code was linked with the C++
- * compiler. If there is no enhanced atexit, and we do have do_exit_code,
- * we register the latter with atexit. There are 5 extra slots in
- * atexit, so this will still be standard conforming. Since the code
- * is registered after the .fini section, it runs before the library
- * cleanup code, leaving nothing for the calls to _do_exit_code_in_range
- * to handle.
- *
- * Remove this code and the associated code in libCrun when the earliest
- * system to be supported is Solaris 8.
- */
- .weak _get_exit_frame_monitor
- .weak __1cG__CrunMdo_exit_code6F_v_
-
- .section .data
- .align 4
-__get_exit_frame_monitor_ptr:
- .4byte _get_exit_frame_monitor
- .type __get_exit_frame_monitor_ptr,@object
- .size __get_exit_frame_monitor_ptr,4
-
- .align 4
-__do_exit_code_ptr:
- .4byte __1cG__CrunMdo_exit_code6F_v_
- .type __do_exit_code_ptr,@object
- .size __do_exit_code_ptr,4
-
- .section .text
-
- lea __get_exit_frame_monitor_ptr, %eax
- movl (%eax), %eax
- testl %eax,%eax
- jz 1f
- lea __do_exit_code_ptr, %eax
- movl (%eax), %eax
- testl %eax, %eax
- jz 1f
- pushl %eax
- call atexit /* atexit(__Crun::do_exit_code()) */
- addl $4,%esp
-1:
-
-/*
- * End of destructor handling code
- */
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-
- movl 8(%ebp),%eax /* argc */
- movl _environ, %edx /* fixed bug 4302802 */
- testl %edx, %edx /* check if _enviorn==0 */
- jne 1f /* fixed bug 4203802 */
- leal 16(%ebp,%eax,4),%edx /* envp */
- movl %edx,_environ /* copy to _environ */
-1:
- andl $-16,%esp /* align the stack */
- subl $4,%esp
-
- pushl %edx
- leal 12(%ebp),%edx /* argv */
- movl %edx,___Argv
- pushl %edx
- pushl %eax /* argc */
- call __fpstart
- call _init
- call main /* main(argc,argv,envp) */
- addl $12,%esp
- pushl %eax /* return value from main */
- pushl %eax /* push it again (for _exit(), below) */
- call exit
- addl $4,%esp
- call _exit /* if user redefined exit, call _exit */
- addl $4,%esp
- hlt
- .size _start, .-_start
diff --git a/usr/src/lib/common/sparc/crti.s b/usr/src/lib/common/sparc/crti.s
deleted file mode 100644
index d48be44c3a..0000000000
--- a/usr/src/lib/common/sparc/crti.s
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries. The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
- .file "crti.s"
-
-/*
- * _init function prologue
- */
- .section ".init"
- .global _init
- .type _init, #function
- .align 4
-
-_init:
- save %sp, -96, %sp
-
-/*
- * _fini function prologue
- */
- .section ".fini"
- .global _fini
- .type _fini, #function
- .align 4
-
-_fini:
- save %sp, -96, %sp
diff --git a/usr/src/lib/common/sparc/crtn.s b/usr/src/lib/common/sparc/crtn.s
deleted file mode 100644
index 4615c4653c..0000000000
--- a/usr/src/lib/common/sparc/crtn.s
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries. The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
- .file "crtn.s"
-
-/*
- * _init function epilogue
- */
- .section ".init"
- .align 4
- ret
- restore
-
-/*
- * _fini function epilogue
- */
- .section ".fini"
- .align 4
- ret
- restore
diff --git a/usr/src/lib/common/Makefile b/usr/src/lib/crt/Makefile
index 0cb21abafa..57ce536003 100644
--- a/usr/src/lib/common/Makefile
+++ b/usr/src/lib/crt/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.lib
@@ -35,12 +33,11 @@ all := TARGET= all
install := TARGET= install
clean := TARGET= clean
clobber := TARGET= clobber
+lint := TARGET= lint
.KEEP_STATE:
-all install clean clobber: $(SUBDIRS)
-
-lint:
+all install clean clobber lint: $(SUBDIRS)
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
diff --git a/usr/src/lib/common/Makefile.com b/usr/src/lib/crt/Makefile.com
index 76e86844bc..9ae8be2310 100644
--- a/usr/src/lib/common/Makefile.com
+++ b/usr/src/lib/crt/Makefile.com
@@ -22,34 +22,38 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
CRTI = crti.o
CRTN = crtn.o
CRT1 = crt1.o
-GCRT1 = gcrt1.o
VALUES = values-Xa.o values-Xc.o values-Xs.o values-Xt.o \
values-xpg4.o values-xpg6.o
+COMMON_CRT = common-crt.o
+MACH_CRT = mach-crt1.o
# include library definitions
include ../../Makefile.lib
+SRCS = $(VALUES:%.o=../common/%.c) $(COMMON_CRT:%.o=../common/%.c)
+
POST_PROCESS_O = $(PROCESS_COMMENT) $@ ; $(STRIP) -x $@
-OBJECTS = $(VALUES) $(CRTI) $(CRTN)
-$(INTEL_BLD)OBJECTS += $(CRT1) $(GCRT1)
+OBJECTS = $(VALUES) $(CRT1) $(CRTI) $(CRTN)
ROOTLIB= $(ROOT)/usr/lib
ROOTLIB64= $(ROOTLIB)/$(MACH64)
ROOTOBJECTS= $(OBJECTS:%=$(ROOTLIB)/%)
ROOTOBJECTS64= $(OBJECTS:%=$(ROOTLIB64)/%)
-ASFLAGS += -P -D__STDC__ -D_ASM -DPIC
+$(INTEL_BLD)ROOTOBJECTS += $(ROOTLIB)/gcrt1.o
+$(INTEL_BLD)ROOTOBJECTS64 += $(ROOTLIB64)/gcrt1.o
+
+ASFLAGS += -P -D__STDC__ -D_ASM -DPIC $(AS_PICFLAGS)
values-xpg6.o := CPPFLAGS += -I$(SRC)/lib/libc/inc
-$(VALUES) := CFLAGS += $(C_PICFLAGS)
-$(VALUES) := CFLAGS64 += $(C_PICFLAGS64)
+values-xpg6.lint := CPPFLAGS += -I$(SRC)/lib/libc/inc
+$(COMMON_CRT) $(VALUES) := CFLAGS += $(C_PICFLAGS)
+$(COMMON_CRT) $(VALUES) := CFLAGS64 += $(C_PICFLAGS64)
.KEEP_STATE:
@@ -58,7 +62,13 @@ all: $(OBJECTS)
clean clobber:
$(RM) $(OBJECTS)
-lint:
+%.lint: ../common/%.c
+ $(LINT.c) $(LINTCHECKFLAGS) $<
+
+lint: $(VALUES:%.o=%.lint) $(COMMON_CRT:%.o=%.lint)
+
+$(CRT1): $(COMMON_CRT) $(MACH_CRT)
+ $(LD) -r $(MACH_CRT) $(COMMON_CRT) -o $(CRT1)
%.o: ../common/%.c
$(COMPILE.c) -o $@ $<
@@ -68,10 +78,21 @@ lint:
$(COMPILE.s) -o $@ $<
$(POST_PROCESS_O)
-# install rule for ROOTOBJECTS and ROOTOBJECTS64
+%.o: ../$(MACH)/%.s
+ $(COMPILE.s) -o $@ $<
+ $(POST_PROCESS_O)
+# install rule for ROOTOBJECTS and ROOTOBJECTS64
$(ROOTLIB)/%.o: %.o
$(INS.file)
+$(ROOTLIB)/gcrt1.o:
+ $(RM) $(ROOTLIB)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB)/gcrt1.o
+
$(ROOTLIB64)/%.o: %.o
$(INS.file)
+
+$(ROOTLIB64)/gcrt1.o:
+ $(RM) $(ROOTLIB64)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB64)/gcrt1.o
+
+FRC:
diff --git a/usr/src/lib/common/amd64/Makefile b/usr/src/lib/crt/amd64/Makefile
index 714b0b5281..16967b67ff 100644
--- a/usr/src/lib/common/amd64/Makefile
+++ b/usr/src/lib/crt/amd64/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/common/amd64/crti.s b/usr/src/lib/crt/amd64/crti.s
index 50ce02825d..14e71e03a5 100644
--- a/usr/src/lib/common/amd64/crti.s
+++ b/usr/src/lib/crt/amd64/crti.s
@@ -53,6 +53,6 @@ _init:
.globl _fini
.type _fini,@function
.align 16
-_fini:
+_fini:
pushq %rbp
movq %rsp, %rbp
diff --git a/usr/src/lib/common/amd64/crtn.s b/usr/src/lib/crt/amd64/crtn.s
index 70b73b88dd..70b73b88dd 100644
--- a/usr/src/lib/common/amd64/crtn.s
+++ b/usr/src/lib/crt/amd64/crtn.s
diff --git a/usr/src/lib/crt/amd64/mach-crt1.s b/usr/src/lib/crt/amd64/mach-crt1.s
new file mode 100644
index 0000000000..9a334f84e4
--- /dev/null
+++ b/usr/src/lib/crt/amd64/mach-crt1.s
@@ -0,0 +1,98 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/asm_linkage.h>
+
+ .file "mach-crt1.s"
+
+ .global _start_crt
+
+/*
+ * The SVR4/amd64 ABI (pages 3-29) says that when the entry
+ * point runs registers' %rbp, %rsp, %rdx values are specified
+ * the following:
+ *
+ * %rbp The content of this register is unspecified at
+ * process initialization time, but the user code should mark
+ * the deepest stack frame by setting the frame pointer to zero.
+ * No other frame's %ebp should have a zero value.
+ *
+ * %rsp Performing its usual job, the stack pointer holds the address
+ * of the bottom of the stack, which is guaranteed to be
+ * quadword aligned.
+ *
+ * The stack contains the arguments and environment:
+ * ...
+ * envp[0] (16+(8*argc))(%rsp)
+ * NULL (8+(8*argc))(%rsp)
+ * ...
+ * argv[0] 8(%rsp)
+ * argc 0(%rsp)
+ *
+ * %rdx In a conforming program, this register contains a function
+ * pointer that the application should register with atexit(BA_OS).
+ * This function is used for shared object termination code
+ * [see Dynamic Linking in Chapter 5 of the System V ABI].
+ *
+ */
+
+ENTRY_NP(_start)
+/*
+ * Allocate a NULL return address and a NULL previous %rbp as if
+ * there was a genuine call to _start.
+ */
+ pushq $0
+ pushq $0
+ movq %rsp,%rbp /* The first stack frame */
+
+/*
+ * The stack now is
+ *
+ * envp[0] (32+(8*argc))(%rsp) - (A)
+ * NULL (24+(8*argc))(%rsp)
+ * ...
+ * argv[0] 24(%rbp) - (B)
+ * argc 16(%rbp)
+ * 0 8(%rbp)
+ * 0 0(%rbp)
+ */
+
+ andq $-16,%rsp /* align the stack */
+ movq 16(%rbp),%rdi /* argc */
+ leaq 24(%rbp),%rsi /* argv */
+ /* NB: rt_do_exit, if applicable, is already in %rdx */
+ call _start_crt
+ hlt
+SET_SIZE(_start)
+
+/*
+ * The following is here in case any object module compiled with cc -p
+ * was linked into this module.
+ */
+ENTRY_NP(_mcount)
+ .weak _mcount
+ ret
+SET_SIZE(_mcount)
diff --git a/usr/src/lib/crt/common/common-crt.c b/usr/src/lib/crt/common/common-crt.c
new file mode 100644
index 0000000000..5598c1f6fa
--- /dev/null
+++ b/usr/src/lib/crt/common/common-crt.c
@@ -0,0 +1,100 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2016, Richard Lowe.
+ */
+
+/*
+ * That of the CRT startup routine which itself may be implemented in C.
+ */
+
+#include <sys/feature_tests.h>
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <synch.h>
+#include <unistd.h>
+
+#pragma weak _DYNAMIC
+extern uintptr_t _DYNAMIC;
+
+#pragma weak environ = _environ
+char **_environ = NULL;
+char **___Argv = NULL;
+
+extern int main(int argc, char **argv, char **envp);
+extern void _init(void);
+extern void _fini(void);
+
+#pragma weak _start_crt_compiler
+extern void _start_crt_compiler(int argc, char **argv);
+
+#if defined(__x86)
+int __longdouble_used = 0;
+extern void __fpstart(void);
+#endif
+
+#if defined(__i386) /* Not amd64 */
+#pragma weak __fsr_init_value
+extern long __fsr_init_value;
+extern void __fsr(uintptr_t);
+#endif
+
+
+/*
+ * Defined here for ABI reasons, must match the definition in libc.
+ * If it cannot, a new symbol must be created.
+ */
+mutex_t __environ_lock = DEFAULTMUTEX;
+
+void
+_start_crt(int argc, char **argv, void (*exit_handler)(void))
+{
+ int ret = 0;
+
+ /*
+ * On x86, we check whether we're a dynamic executable to see whether
+ * we'll receive an exit_handler.
+ *
+ * On SPARC, we just need to check whether the handler was NULL.
+ */
+#if defined(__x86)
+ if (&_DYNAMIC != NULL)
+ (void) atexit(exit_handler);
+#elif defined(__sparc)
+ if (exit_handler != NULL)
+ (void) atexit(exit_handler);
+#endif
+
+ (void) atexit(_fini);
+
+ _environ = argv + (argc + 1);
+ ___Argv = argv;
+
+ if (&_start_crt_compiler != NULL)
+ _start_crt_compiler(argc, argv);
+
+#if defined(__x86)
+ __fpstart();
+#endif
+#if defined(__i386) /* Not amd64 */
+ /*
+ * Note that Studio cc(1) sets the _value of the symbol_, that is, its
+ * address. Not the value _at_ that address.
+ */
+ __fsr((uintptr_t)&__fsr_init_value);
+#endif
+ _init();
+ ret = main(argc, argv, _environ);
+ exit(ret);
+ _exit(ret);
+}
diff --git a/usr/src/lib/common/common/values-Xa.c b/usr/src/lib/crt/common/values-Xa.c
index fcd21db588..041a6dc8b0 100644
--- a/usr/src/lib/common/common/values-Xa.c
+++ b/usr/src/lib/crt/common/values-Xa.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
diff --git a/usr/src/lib/common/common/values-Xc.c b/usr/src/lib/crt/common/values-Xc.c
index 12d47c7ac0..ef70ae97a7 100644
--- a/usr/src/lib/common/common/values-Xc.c
+++ b/usr/src/lib/crt/common/values-Xc.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
diff --git a/usr/src/lib/common/common/values-Xs.c b/usr/src/lib/crt/common/values-Xs.c
index 899669b6de..b876d90724 100644
--- a/usr/src/lib/common/common/values-Xs.c
+++ b/usr/src/lib/crt/common/values-Xs.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
diff --git a/usr/src/lib/common/common/values-Xt.c b/usr/src/lib/crt/common/values-Xt.c
index 899669b6de..b876d90724 100644
--- a/usr/src/lib/common/common/values-Xt.c
+++ b/usr/src/lib/crt/common/values-Xt.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
diff --git a/usr/src/lib/common/common/values-xpg4.c b/usr/src/lib/crt/common/values-xpg4.c
index d72bffa6c8..54b5afc883 100644
--- a/usr/src/lib/common/common/values-xpg4.c
+++ b/usr/src/lib/crt/common/values-xpg4.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
/*
* Setting thie value to 1 enables XPG4 mode for APIs
diff --git a/usr/src/lib/common/common/values-xpg6.c b/usr/src/lib/crt/common/values-xpg6.c
index ea46fd5439..2e9e64efc2 100644
--- a/usr/src/lib/common/common/values-xpg6.c
+++ b/usr/src/lib/crt/common/values-xpg6.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* __xpg6 (C99/SUSv3) was first introduced in Solaris 10.
*
diff --git a/usr/src/lib/common/i386/Makefile b/usr/src/lib/crt/i386/Makefile
index 68fee1b0a9..5affa893b7 100644
--- a/usr/src/lib/common/i386/Makefile
+++ b/usr/src/lib/crt/i386/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
diff --git a/usr/src/lib/common/i386/crti.s b/usr/src/lib/crt/i386/crti.s
index 8f8a7ed477..8e630511ca 100644
--- a/usr/src/lib/common/i386/crti.s
+++ b/usr/src/lib/crt/i386/crti.s
@@ -48,7 +48,7 @@
*
* - lib/libc/i386/threads/machdep.c
* - lib/libc/i386/gen/makectxt.c
- * - lib/common/i386/crt1.s
+ * - lib/crt/i386/mach-crt1.s
*/
/*
diff --git a/usr/src/lib/common/i386/crtn.s b/usr/src/lib/crt/i386/crtn.s
index 6e37e25a8f..413c102006 100644
--- a/usr/src/lib/common/i386/crtn.s
+++ b/usr/src/lib/crt/i386/crtn.s
@@ -33,7 +33,6 @@
*
* For further details - see bug#4433015
*/
- .ident "%Z%%M% %I% %E% SMI"
.file "crtn.s"
/*
diff --git a/usr/src/lib/common/i386/fsr.s b/usr/src/lib/crt/i386/fsr.s
index 426d0266e2..bafc28042f 100644
--- a/usr/src/lib/common/i386/fsr.s
+++ b/usr/src/lib/crt/i386/fsr.s
@@ -24,20 +24,13 @@
* Use is subject to license terms.
*/
- .ident "%Z%%M% %I% %E% SMI"
+#include <sys/asm_linkage.h>
.file "fsr.s"
.section .data
.align 4
- .weak __fsr_init_value
-
-__fsr_init_value_ptr:
- .4byte __fsr_init_value
- .type __fsr_init_value_ptr,@object
- .size __fsr_init_value_ptr,4
-
/*
* The following table maps trap enable bits in __fsr_init_value
* (after shifting right one bit):
@@ -94,20 +87,20 @@ trap_table:
.size trap_table,32
- .section .text
- .align 4
-
- .globl __fsr
- .type __fsr,@function
-__fsr:
+ENTRY_NP(__fsr)
pushl %ebp
movl %esp,%ebp
pushl %edx
pushl %ecx
+ pushl %ebx
subl $4,%esp
- lea __fsr_init_value_ptr, %ecx
- movl (%ecx),%ecx /* get the value set by CG */
+ /* Setup PIC */
+ call 9f
+9: popl %ebx
+ addl $_GLOBAL_OFFSET_TABLE_ + [. - 9b], %ebx
+
+ movl 8(%ebp), %ecx /* the value set by CG is passed in */
shrl $1,%ecx /* get rid of fns bit */
cmpl $0,%ecx /* if remaining bits are zero */
je 3f /* there's nothing to do */
@@ -116,7 +109,9 @@ __fsr:
movl %ecx,%edx
andl $0x1f,%edx /* get the trap enable bits */
- movb trap_table(%edx),%al
+ movl trap_table@GOT(%ebx), %eax
+ addl %eax,%edx
+ movb (%edx),%al
andb %al,0(%esp) /* unmask the corresponding exceptions */
testl $0x200,%ecx /* test denormal trap enable */
@@ -151,9 +146,9 @@ __fsr:
3:
addl $4,%esp
+ popl %ebx
popl %ecx
popl %edx
popl %ebp
ret
-
- .size __fsr,[.-__fsr]
+SET_SIZE(__fsr)
diff --git a/usr/src/lib/crt/i386/mach-crt1.s b/usr/src/lib/crt/i386/mach-crt1.s
new file mode 100644
index 0000000000..1824d41ec3
--- /dev/null
+++ b/usr/src/lib/crt/i386/mach-crt1.s
@@ -0,0 +1,80 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+#include <sys/asm_linkage.h>
+
+ .file "mach-crt1.s"
+
+/* global entities defined elsewhere but used here */
+ .globl _start_crt
+
+/*
+ * C language startup routine.
+ * Assume that exec code has cleared the direction flag in the TSS.
+ * Assume that %esp is set to the addr after the last word pushed.
+ * The stack contains (in order): argc, argv[],envp[],...
+ * Assume that all of the segment registers are initialized.
+ *
+ * Allocate a NULL return address and a NULL previous %ebp as if
+ * there was a genuine call to _start.
+ * debugger stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
+ */
+ENTRY_NP(_start)
+ pushl $0
+ pushl $0
+ movl %esp,%ebp /* The first stack frame */
+
+ /*
+ * The stack needs to be 16-byte aligned with a 4-byte bias. See
+ * comment in lib/libc/i386/gen/makectxt.c.
+ *
+ * Note: If you change it, you need to change it in the following
+ * files as well:
+ *
+ * - lib/libc/i386/threads/machdep.c
+ * - lib/libc/i386/gen/makectxt.c
+ * - lib/crt/i386/crti.s
+ */
+ andl $-16,%esp /* make main() and exit() be called with */
+ subl $4,%esp /* a properly aligned stack pointer */
+ pushl %edx /* possible atexit handler */
+ leal 12(%ebp),%edx /* argv */
+ movl 8(%ebp),%eax /* argc */
+ pushl %edx
+ pushl %eax
+ call _start_crt
+ hlt
+SET_SIZE(_start)
+
+#include "fsr.s"
+
+/*
+ * The following is here in case any object module compiled with cc -p
+ * was linked into this module.
+ */
+ENTRY_NP(_mcount)
+ .weak _mcount
+ ret
+SET_SIZE(_mcount)
diff --git a/usr/src/lib/common/sparc/Makefile b/usr/src/lib/crt/sparc/Makefile
index 68fee1b0a9..5affa893b7 100644
--- a/usr/src/lib/common/sparc/Makefile
+++ b/usr/src/lib/crt/sparc/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
diff --git a/usr/src/lib/common/sparcv9/crti.s b/usr/src/lib/crt/sparc/crti.s
index c457355a1d..c457355a1d 100644
--- a/usr/src/lib/common/sparcv9/crti.s
+++ b/usr/src/lib/crt/sparc/crti.s
diff --git a/usr/src/lib/common/sparcv9/crtn.s b/usr/src/lib/crt/sparc/crtn.s
index 002bd6f053..002bd6f053 100644
--- a/usr/src/lib/common/sparcv9/crtn.s
+++ b/usr/src/lib/crt/sparc/crtn.s
diff --git a/usr/src/lib/crt/sparc/mach-crt1.s b/usr/src/lib/crt/sparc/mach-crt1.s
new file mode 100644
index 0000000000..989a69777c
--- /dev/null
+++ b/usr/src/lib/crt/sparc/mach-crt1.s
@@ -0,0 +1,75 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/* Copyright 2016, Richard Lowe. */
+
+#include <sys/asm_linkage.h>
+#include <sys/stack.h>
+
+ .file "mach-crt1.s"
+
+ .global _start_crt
+
+#if defined(__sparcv9)
+#define EB_MAX_SIZE 128
+#else
+#define EB_MAX_SIZE 64
+#endif
+
+ENTRY_NP(_start)
+ /*
+ * On entry, the stack is:
+ *
+ * .-----------------------. <--- %sp
+ * | |
+ * | Window |
+ * | |
+ * |-----------------------|
+ * | argc |
+ * |-----------------------|
+ * | argv[0] |
+ * | argv[1] |
+ * | argv[2] |
+ * | argv[3] |
+ * | ... |
+ * | argv[argc - 1] |
+ * |-----------------------|
+ * | NULL |
+ * |-----------------------|
+ * | envp[0] |
+ * | envp[1] |
+ * | envp[2] |
+ * | envp[3] |
+ * | ... |
+ * | envp[N] |
+ * |-----------------------|
+ * | NULL |
+ * .-----------------------.
+ *
+ * and an exit handler from the linker is in %g1
+ */
+ clr %fp ! don't trace the stack past this point
+
+ add %sp, WINDOWSIZE + STACK_BIAS, %l0 ! address of argc
+
+ ! allocate a minimally sized frame, and align ourselves
+ add %sp, -SA(MINFRAME - EB_MAX_SIZE), %sp
+
+ ldn [%l0], %o0 ! argc
+ add %l0, CPTRSIZE, %o1 ! argv
+ call _start_crt
+ mov %g1, %o2 ! exit_handler in delay slot
+SET_SIZE(_start)
diff --git a/usr/src/lib/common/sparcv9/Makefile b/usr/src/lib/crt/sparcv9/Makefile
index 714b0b5281..16967b67ff 100644
--- a/usr/src/lib/common/sparcv9/Makefile
+++ b/usr/src/lib/crt/sparcv9/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/libc/Makefile.targ b/usr/src/lib/libc/Makefile.targ
index d78aace6d0..cd34c5ae91 100644
--- a/usr/src/lib/libc/Makefile.targ
+++ b/usr/src/lib/libc/Makefile.targ
@@ -270,7 +270,7 @@ pics/%.o: $(LIBCBASE)/../port/sys/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-pics/%.o: $(LIBCBASE)/../../common/common/%.c
+pics/%.o: $(LIBCBASE)/../../crt/common/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile
index 2fe0b7bafe..07c2fc1f0f 100644
--- a/usr/src/lib/libc/amd64/Makefile
+++ b/usr/src/lib/libc/amd64/Makefile
@@ -991,7 +991,7 @@ TRACEOBJS= \
plockstat.o
# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
-# modules whose source is provided in the $(SRC)/lib/common directory.
+# modules whose source is provided in the $(SRC)/lib/crt directory.
# This must be done because otherwise the Sun C compiler would insert
# its own versions of these modules and those versions contain code
# to call out to C++ initialization functions. Such C++ initialization
@@ -1000,7 +1000,7 @@ TRACEOBJS= \
# Since libc contains no C++ code, linking with the minimal crti.o and
# crtn.o modules is safe and avoids the problems described above.
OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
-CRTSRCS= ../../common/amd64
+CRTSRCS= ../../crt/amd64
# include common library definitions
include ../../Makefile.lib
diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com
index 3edbed15e0..c8ce23c765 100644
--- a/usr/src/lib/libc/i386/Makefile.com
+++ b/usr/src/lib/libc/i386/Makefile.com
@@ -1033,7 +1033,7 @@ TRACEOBJS= \
plockstat.o
# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
-# modules whose source is provided in the $(SRC)/lib/common directory.
+# modules whose source is provided in the $(SRC)/lib/crt directory.
# This must be done because otherwise the Sun C compiler would insert
# its own versions of these modules and those versions contain code
# to call out to C++ initialization functions. Such C++ initialization
@@ -1042,7 +1042,7 @@ TRACEOBJS= \
# Since libc contains no C++ code, linking with the minimal crti.o and
# crtn.o modules is safe and avoids the problems described above.
OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
-CRTSRCS= ../../common/i386
+CRTSRCS= ../../crt/i386
LDPASS_OFF= $(POUND_SIGN)
diff --git a/usr/src/lib/libc/i386/gen/makectxt.c b/usr/src/lib/libc/i386/gen/makectxt.c
index 27ea2a5fc6..6714aeadea 100644
--- a/usr/src/lib/libc/i386/gen/makectxt.c
+++ b/usr/src/lib/libc/i386/gen/makectxt.c
@@ -64,8 +64,8 @@
* files as well:
*
* - lib/libc/i386/threads/machdep.c
- * - lib/common/i386/crti.s
- * - lib/common/i386/crt1.s
+ * - lib/crt/i386/crti.s
+ * - lib/crt/i386/crt1.s
*/
#undef STACK_ALIGN
#define STACK_ALIGN 16
diff --git a/usr/src/lib/libc/i386/threads/machdep.c b/usr/src/lib/libc/i386/threads/machdep.c
index a39a4a0908..06bfa94813 100644
--- a/usr/src/lib/libc/i386/threads/machdep.c
+++ b/usr/src/lib/libc/i386/threads/machdep.c
@@ -36,8 +36,8 @@
* well:
*
* - lib/libc/i386/gen/makectxt.c
- * - lib/common/i386/crti.s
- * - lib/common/i386/crt1.s
+ * - lib/crt/i386/crti.s
+ * - lib/crt/i386/crt1.s
*/
#undef STACK_ALIGN
#define STACK_ALIGN 16
@@ -86,7 +86,7 @@ setup_top_frame(void *stk, size_t stksize, ulwp_t *ulwp)
int
setup_context(ucontext_t *ucp, void *(*func)(ulwp_t *),
- ulwp_t *ulwp, caddr_t stk, size_t stksize)
+ ulwp_t *ulwp, caddr_t stk, size_t stksize)
{
static int initialized;
static greg_t fs, es, ds, cs, ss;
@@ -210,10 +210,10 @@ setgregs(ulwp_t *ulwp, gregset_t rs)
int
__csigsetjmp(greg_t cs, greg_t ss, greg_t gs,
- greg_t fs, greg_t es, greg_t ds,
- greg_t edi, greg_t esi, greg_t ebp, greg_t esp,
- greg_t ebx, greg_t edx, greg_t ecx, greg_t eax, greg_t eip,
- sigjmp_buf env, int savemask)
+ greg_t fs, greg_t es, greg_t ds,
+ greg_t edi, greg_t esi, greg_t ebp, greg_t esp,
+ greg_t ebx, greg_t edx, greg_t ecx, greg_t eax, greg_t eip,
+ sigjmp_buf env, int savemask)
{
ucontext_t *ucp = (ucontext_t *)env;
ulwp_t *self = curthread;
diff --git a/usr/src/lib/libc/req.flg b/usr/src/lib/libc/req.flg
index b501dc546b..51dec5432f 100644
--- a/usr/src/lib/libc/req.flg
+++ b/usr/src/lib/libc/req.flg
@@ -28,4 +28,4 @@ find_files "s.*" usr/src/common/atomic
find_files "s.*" usr/src/common/dtrace
find_files "s.*" usr/src/common/secflags
find_files "s.*" usr/src/common/util
-find_files "s.*" usr/src/lib/common
+find_files "s.*" usr/src/lib/crt
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index 8ad448f56a..e76f1cc175 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -1064,7 +1064,7 @@ TRACEOBJS= \
plockstat.o
# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
-# modules whose source is provided in the $(SRC)/lib/common directory.
+# modules whose source is provided in the $(SRC)/lib/crt directory.
# This must be done because otherwise the Sun C compiler would insert
# its own versions of these modules and those versions contain code
# to call out to C++ initialization functions. Such C++ initialization
@@ -1073,7 +1073,7 @@ TRACEOBJS= \
# Since libc contains no C++ code, linking with the minimal crti.o and
# crtn.o modules is safe and avoids the problems described above.
OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
-CRTSRCS= ../../common/sparc
+CRTSRCS= ../../crt/sparc
# include common library definitions
include $(SRC)/lib/Makefile.lib
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index 5c131719c9..632aa62dd2 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -1004,7 +1004,7 @@ TRACEOBJS= \
plockstat.o
# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
-# modules whose source is provided in the $(SRC)/lib/common directory.
+# modules whose source is provided in the $(SRC)/lib/crt directory.
# This must be done because otherwise the Sun C compiler would insert
# its own versions of these modules and those versions contain code
# to call out to C++ initialization functions. Such C++ initialization
@@ -1013,7 +1013,7 @@ TRACEOBJS= \
# Since libc contains no C++ code, linking with the minimal crti.o and
# crtn.o modules is safe and avoids the problems described above.
OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
-CRTSRCS= ../../common/sparcv9
+CRTSRCS= ../../crt/sparc
# include common library definitions
include $(SRC)/lib/Makefile.lib
diff --git a/usr/src/lib/libc_db/amd64/Makefile b/usr/src/lib/libc_db/amd64/Makefile
index bc6ff111f4..9a111ae271 100644
--- a/usr/src/lib/libc_db/amd64/Makefile
+++ b/usr/src/lib/libc_db/amd64/Makefile
@@ -23,10 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-CRTSRCS= ../../common/amd64
+CRTSRCS= ../../crt/amd64
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/libc_db/i386/Makefile b/usr/src/lib/libc_db/i386/Makefile
index efa5167a53..cce50fc565 100644
--- a/usr/src/lib/libc_db/i386/Makefile
+++ b/usr/src/lib/libc_db/i386/Makefile
@@ -23,10 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-CRTSRCS= ../../common/i386
+CRTSRCS= ../../crt/i386
include ../Makefile.com
diff --git a/usr/src/lib/libc_db/sparc/Makefile b/usr/src/lib/libc_db/sparc/Makefile
index 9c8a9b0d2e..6d3026e506 100644
--- a/usr/src/lib/libc_db/sparc/Makefile
+++ b/usr/src/lib/libc_db/sparc/Makefile
@@ -23,10 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-CRTSRCS= ../../common/sparc
+CRTSRCS= ../../crt/sparc
include ../Makefile.com
diff --git a/usr/src/lib/libc_db/sparcv9/Makefile b/usr/src/lib/libc_db/sparcv9/Makefile
index 93ae33d622..ee65b634b0 100644
--- a/usr/src/lib/libc_db/sparcv9/Makefile
+++ b/usr/src/lib/libc_db/sparcv9/Makefile
@@ -23,10 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-CRTSRCS= ../../common/sparcv9
+CRTSRCS= ../../crt/sparc
include ../Makefile.com
include ../../Makefile.lib.64
diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com
index 4885156c2b..792e1cd24f 100644
--- a/usr/src/lib/libnsl/Makefile.com
+++ b/usr/src/lib/libnsl/Makefile.com
@@ -188,7 +188,7 @@ NOEXCEPTIONS= -noex
CCFLAGS += $(NOEXCEPTIONS)
CCFLAGS64 += $(NOEXCEPTIONS)
-CPPFLAGS += -I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT
+CPPFLAGS += -I$(SRC)/lib/libnsl/include -D_REENTRANT
CPPFLAGS += -I$(SRC)/lib/libnsl/dial
CFLAGS += $(CCVERBOSE)
diff --git a/usr/src/lib/req.flg b/usr/src/lib/req.flg
index afe21c920d..89ff86fb39 100644
--- a/usr/src/lib/req.flg
+++ b/usr/src/lib/req.flg
@@ -23,14 +23,12 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
echo_file usr/src/lib/Makefile.lib
echo_file usr/src/lib/Makefile.targ
echo_file usr/src/lib/Makefile.mach
echo_file usr/src/lib/Makefile.lib.64
echo_file usr/src/lib/Makefile.rootfs
-find_files "s.*" usr/src/lib/common
+find_files "s.*" usr/src/lib/crt
find_files "s.*" usr/src/common/mapfiles
exec_file usr/src/cmd/req.flg
diff --git a/usr/src/pkg/manifests/developer-library-lint.mf b/usr/src/pkg/manifests/developer-library-lint.mf
index c77e0ff388..8a2480ee39 100644
--- a/usr/src/pkg/manifests/developer-library-lint.mf
+++ b/usr/src/pkg/manifests/developer-library-lint.mf
@@ -26,8 +26,7 @@
#
set name=pkg.fmri value=pkg:/developer/library/lint@$(PKGVERS)
-set name=pkg.description \
- value="lint libraries and startup objects for software development"
+set name=pkg.description value="lint libraries for software development"
set name=pkg.summary value="Lint Libraries"
set name=info.classification value=org.opensolaris.category.2008:Development/C
set name=variant.arch value=$(ARCH)
@@ -200,10 +199,6 @@ file path=lib/llib-luuid
file path=lib/llib-luuid.ln
file path=lib/llib-lxnet
file path=lib/llib-lxnet.ln
-$(i386_ONLY)file path=usr/lib/$(ARCH64)/crt1.o
-file path=usr/lib/$(ARCH64)/crti.o
-file path=usr/lib/$(ARCH64)/crtn.o
-$(i386_ONLY)file path=usr/lib/$(ARCH64)/gcrt1.o
file path=usr/lib/$(ARCH64)/llib-lads.ln
file path=usr/lib/$(ARCH64)/llib-ladutils.ln
file path=usr/lib/$(ARCH64)/llib-lbsdmalloc.ln
@@ -243,16 +238,6 @@ $(sparc_ONLY)file path=usr/lib/$(ARCH64)/llib-lv12n.ln
file path=usr/lib/$(ARCH64)/llib-lvolmgt.ln
file path=usr/lib/$(ARCH64)/llib-lwrap.ln
file path=usr/lib/$(ARCH64)/llib-lzoneinfo.ln
-file path=usr/lib/$(ARCH64)/values-Xa.o
-file path=usr/lib/$(ARCH64)/values-Xc.o
-file path=usr/lib/$(ARCH64)/values-Xs.o
-file path=usr/lib/$(ARCH64)/values-Xt.o
-file path=usr/lib/$(ARCH64)/values-xpg4.o
-file path=usr/lib/$(ARCH64)/values-xpg6.o
-$(i386_ONLY)file path=usr/lib/crt1.o
-file path=usr/lib/crti.o
-file path=usr/lib/crtn.o
-$(i386_ONLY)file path=usr/lib/gcrt1.o
file path=usr/lib/llib-lads
file path=usr/lib/llib-lads.ln
file path=usr/lib/llib-ladutils
@@ -339,12 +324,6 @@ file path=usr/lib/scsi/llib-lses
file path=usr/lib/scsi/llib-lses.ln
file path=usr/lib/scsi/llib-lsmp
file path=usr/lib/scsi/llib-lsmp.ln
-file path=usr/lib/values-Xa.o
-file path=usr/lib/values-Xc.o
-file path=usr/lib/values-Xs.o
-file path=usr/lib/values-Xt.o
-file path=usr/lib/values-xpg4.o
-file path=usr/lib/values-xpg6.o
file path=usr/xpg4/lib/$(ARCH64)/llib-lcurses.ln
file path=usr/xpg4/lib/llib-lcurses
file path=usr/xpg4/lib/llib-lcurses.ln
@@ -379,18 +358,6 @@ link path=usr/ccs/lib/$(ARCH64)/llib-ltermlib.ln \
target=../../../../lib/$(ARCH64)/llib-lcurses.ln
link path=usr/ccs/lib/$(ARCH64)/llib-ly.ln \
target=../../../lib/$(ARCH64)/llib-ly.ln
-link path=usr/ccs/lib/$(ARCH64)/values-Xa.o \
- target=../../../lib/$(ARCH64)/values-Xa.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xc.o \
- target=../../../lib/$(ARCH64)/values-Xc.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xs.o \
- target=../../../lib/$(ARCH64)/values-Xs.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xt.o \
- target=../../../lib/$(ARCH64)/values-Xt.o
-link path=usr/ccs/lib/$(ARCH64)/values-xpg4.o \
- target=../../../lib/$(ARCH64)/values-xpg4.o
-link path=usr/ccs/lib/$(ARCH64)/values-xpg6.o \
- target=../../../lib/$(ARCH64)/values-xpg6.o
link path=usr/ccs/lib/llib-lcurses target=../../../lib/llib-lcurses
link path=usr/ccs/lib/llib-lcurses.ln target=../../../lib/llib-lcurses.ln
link path=usr/ccs/lib/llib-lform target=../../lib/llib-lform
@@ -405,12 +372,6 @@ link path=usr/ccs/lib/llib-ltermcap target=../../../lib/llib-ltermcap
link path=usr/ccs/lib/llib-ltermcap.ln target=../../../lib/llib-ltermcap.ln
link path=usr/ccs/lib/llib-ltermlib target=../../../lib/llib-lcurses
link path=usr/ccs/lib/llib-ltermlib.ln target=../../../lib/llib-lcurses.ln
-link path=usr/ccs/lib/values-Xa.o target=../../lib/values-Xa.o
-link path=usr/ccs/lib/values-Xc.o target=../../lib/values-Xc.o
-link path=usr/ccs/lib/values-Xs.o target=../../lib/values-Xs.o
-link path=usr/ccs/lib/values-Xt.o target=../../lib/values-Xt.o
-link path=usr/ccs/lib/values-xpg4.o target=../../lib/values-xpg4.o
-link path=usr/ccs/lib/values-xpg6.o target=../../lib/values-xpg6.o
link path=usr/lib/$(ARCH64)/llib-ladm.ln \
target=../../../lib/$(ARCH64)/llib-ladm.ln
link path=usr/lib/$(ARCH64)/llib-laio.ln \
@@ -585,3 +546,5 @@ link path=usr/lib/llib-luuid target=../../lib/llib-luuid
link path=usr/lib/llib-luuid.ln target=../../lib/llib-luuid.ln
link path=usr/lib/llib-lxnet target=../../lib/llib-lxnet
link path=usr/lib/llib-lxnet.ln target=../../lib/llib-lxnet.ln
+# Used to be incorrectly in this package, pull it in for compatibility
+depend fmri=system/library/c-runtime type=group
diff --git a/usr/src/pkg/manifests/system-library-c-runtime.mf b/usr/src/pkg/manifests/system-library-c-runtime.mf
new file mode 100644
index 0000000000..2151c03897
--- /dev/null
+++ b/usr/src/pkg/manifests/system-library-c-runtime.mf
@@ -0,0 +1,57 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2016, Richard Lowe.
+set name=pkg.fmri value=pkg:/system/library/c-runtime@$(PKGVERS)
+set name=pkg.description value="C runtime objects"
+set name=pkg.summary value="C Runtime"
+set name=info.classification value=org.opensolaris.category.2008:Development/C
+set name=variant.arch value=$(ARCH)
+file path=usr/lib/$(ARCH64)/crt1.o
+file path=usr/lib/$(ARCH64)/crti.o
+file path=usr/lib/$(ARCH64)/crtn.o
+file path=usr/lib/$(ARCH64)/values-Xa.o
+file path=usr/lib/$(ARCH64)/values-Xc.o
+file path=usr/lib/$(ARCH64)/values-Xs.o
+file path=usr/lib/$(ARCH64)/values-Xt.o
+file path=usr/lib/$(ARCH64)/values-xpg4.o
+file path=usr/lib/$(ARCH64)/values-xpg6.o
+file path=usr/lib/crt1.o
+file path=usr/lib/crti.o
+file path=usr/lib/crtn.o
+file path=usr/lib/values-Xa.o
+file path=usr/lib/values-Xc.o
+file path=usr/lib/values-Xs.o
+file path=usr/lib/values-Xt.o
+file path=usr/lib/values-xpg4.o
+file path=usr/lib/values-xpg6.o
+license cr_Sun license=cr_Sun
+license lic_CDDL license=lic_CDDL
+link path=usr/ccs/lib/$(ARCH64)/values-Xa.o \
+ target=../../../lib/$(ARCH64)/values-Xa.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xc.o \
+ target=../../../lib/$(ARCH64)/values-Xc.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xs.o \
+ target=../../../lib/$(ARCH64)/values-Xs.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xt.o \
+ target=../../../lib/$(ARCH64)/values-Xt.o
+link path=usr/ccs/lib/$(ARCH64)/values-xpg4.o \
+ target=../../../lib/$(ARCH64)/values-xpg4.o
+link path=usr/ccs/lib/$(ARCH64)/values-xpg6.o \
+ target=../../../lib/$(ARCH64)/values-xpg6.o
+link path=usr/ccs/lib/values-Xa.o target=../../lib/values-Xa.o
+link path=usr/ccs/lib/values-Xc.o target=../../lib/values-Xc.o
+link path=usr/ccs/lib/values-Xs.o target=../../lib/values-Xs.o
+link path=usr/ccs/lib/values-Xt.o target=../../lib/values-Xt.o
+link path=usr/ccs/lib/values-xpg4.o target=../../lib/values-xpg4.o
+link path=usr/ccs/lib/values-xpg6.o target=../../lib/values-xpg6.o
+$(i386_ONLY)link path=usr/lib/$(ARCH64)/gcrt1.o target=crt1.o
+$(i386_ONLY)link path=usr/lib/gcrt1.o target=crt1.o