From 3e76f9d6851ef6c63217178eb67278ec2809b944 Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Wed, 16 Apr 2014 20:03:15 +0100 Subject: 8609 want a position independent CRT Reviewed by: Robert Mustacchi Reviewed by: Patrick Mooney Reviewed by: Albert Lee Approved by: Dan McDonald --- usr/src/cmd/awk_xpg4/Makefile | 4 +- usr/src/cmd/awk_xpg4/inc.flg | 30 --- usr/src/cmd/cron/Makefile | 4 +- usr/src/cmd/cron/inc.flg | 31 ---- usr/src/cmd/date/Makefile | 6 +- usr/src/cmd/date/inc.flg | 30 --- usr/src/cmd/ed/Makefile | 8 +- usr/src/cmd/ed/inc.flg | 3 - usr/src/cmd/env/Makefile | 6 +- usr/src/cmd/env/inc.flg | 30 --- usr/src/cmd/getconf/Makefile | 4 +- usr/src/cmd/getconf/inc.flg | 31 ---- usr/src/cmd/link/Makefile | 4 +- usr/src/cmd/link/inc.flg | 30 --- usr/src/cmd/mv/Makefile | 4 +- usr/src/cmd/mv/inc.flg | 31 ---- usr/src/cmd/nice/Makefile | 6 +- usr/src/cmd/nice/inc.flg | 30 --- usr/src/cmd/sgs/0@0/Makefile.com | 1 - usr/src/cmd/sgs/0@0/amd64/Makefile | 4 +- usr/src/cmd/sgs/0@0/i386/Makefile | 3 +- usr/src/cmd/sgs/0@0/sparc/Makefile | 3 +- usr/src/cmd/sgs/0@0/sparcv9/Makefile | 3 +- usr/src/cmd/sgs/rtld/amd64/Makefile | 2 +- usr/src/cmd/sgs/rtld/i386/Makefile | 2 +- usr/src/cmd/sgs/rtld/sparc/Makefile | 2 +- usr/src/cmd/sgs/rtld/sparcv9/Makefile | 2 +- usr/src/cmd/vi/port/Makefile | 8 +- usr/src/cmd/vi/port/inc.flg | 6 +- usr/src/lib/Makefile | 6 +- usr/src/lib/common/Makefile | 48 ----- usr/src/lib/common/Makefile.com | 77 -------- usr/src/lib/common/amd64/Makefile | 32 ---- usr/src/lib/common/amd64/crt1.s | 192 ------------------- usr/src/lib/common/amd64/crti.s | 58 ------ usr/src/lib/common/amd64/crtn.s | 50 ----- usr/src/lib/common/amd64/gcrt1.s | 191 ------------------- usr/src/lib/common/common/values-Xa.c | 45 ----- usr/src/lib/common/common/values-Xc.c | 45 ----- usr/src/lib/common/common/values-Xs.c | 47 ----- usr/src/lib/common/common/values-Xt.c | 47 ----- usr/src/lib/common/common/values-xpg4.c | 36 ---- usr/src/lib/common/common/values-xpg6.c | 57 ------ usr/src/lib/common/i386/Makefile | 31 ---- usr/src/lib/common/i386/crt1.s | 216 ---------------------- usr/src/lib/common/i386/crti.s | 86 --------- usr/src/lib/common/i386/crtn.s | 55 ------ usr/src/lib/common/i386/fsr.s | 159 ---------------- usr/src/lib/common/i386/gcrt1.s | 206 --------------------- usr/src/lib/common/sparc/Makefile | 31 ---- usr/src/lib/common/sparc/crti.s | 60 ------ usr/src/lib/common/sparc/crtn.s | 54 ------ usr/src/lib/common/sparcv9/Makefile | 32 ---- usr/src/lib/common/sparcv9/crti.s | 59 ------ usr/src/lib/common/sparcv9/crtn.s | 52 ------ usr/src/lib/crt/Makefile | 45 +++++ usr/src/lib/crt/Makefile.com | 98 ++++++++++ usr/src/lib/crt/amd64/Makefile | 30 +++ usr/src/lib/crt/amd64/crti.s | 58 ++++++ usr/src/lib/crt/amd64/crtn.s | 50 +++++ usr/src/lib/crt/amd64/mach-crt1.s | 98 ++++++++++ usr/src/lib/crt/common/common-crt.c | 100 ++++++++++ usr/src/lib/crt/common/values-Xa.c | 43 +++++ usr/src/lib/crt/common/values-Xc.c | 43 +++++ usr/src/lib/crt/common/values-Xs.c | 45 +++++ usr/src/lib/crt/common/values-Xt.c | 45 +++++ usr/src/lib/crt/common/values-xpg4.c | 34 ++++ usr/src/lib/crt/common/values-xpg6.c | 55 ++++++ usr/src/lib/crt/i386/Makefile | 29 +++ usr/src/lib/crt/i386/crti.s | 86 +++++++++ usr/src/lib/crt/i386/crtn.s | 54 ++++++ usr/src/lib/crt/i386/fsr.s | 154 +++++++++++++++ usr/src/lib/crt/i386/mach-crt1.s | 80 ++++++++ usr/src/lib/crt/sparc/Makefile | 29 +++ usr/src/lib/crt/sparc/crti.s | 59 ++++++ usr/src/lib/crt/sparc/crtn.s | 52 ++++++ usr/src/lib/crt/sparc/mach-crt1.s | 75 ++++++++ usr/src/lib/crt/sparcv9/Makefile | 30 +++ usr/src/lib/libc/Makefile.targ | 2 +- usr/src/lib/libc/amd64/Makefile | 4 +- usr/src/lib/libc/i386/Makefile.com | 4 +- usr/src/lib/libc/i386/gen/makectxt.c | 4 +- usr/src/lib/libc/i386/threads/machdep.c | 14 +- usr/src/lib/libc/req.flg | 2 +- usr/src/lib/libc/sparc/Makefile.com | 4 +- usr/src/lib/libc/sparcv9/Makefile.com | 4 +- usr/src/lib/libc_db/amd64/Makefile | 4 +- usr/src/lib/libc_db/i386/Makefile | 4 +- usr/src/lib/libc_db/sparc/Makefile | 4 +- usr/src/lib/libc_db/sparcv9/Makefile | 4 +- usr/src/lib/libnsl/Makefile.com | 2 +- usr/src/lib/req.flg | 4 +- usr/src/pkg/manifests/developer-library-lint.mf | 43 +---- usr/src/pkg/manifests/system-library-c-runtime.mf | 57 ++++++ 94 files changed, 1513 insertions(+), 2339 deletions(-) delete mode 100644 usr/src/cmd/awk_xpg4/inc.flg delete mode 100644 usr/src/cmd/cron/inc.flg delete mode 100644 usr/src/cmd/date/inc.flg delete mode 100644 usr/src/cmd/env/inc.flg delete mode 100644 usr/src/cmd/getconf/inc.flg delete mode 100644 usr/src/cmd/link/inc.flg delete mode 100644 usr/src/cmd/mv/inc.flg delete mode 100644 usr/src/cmd/nice/inc.flg delete mode 100644 usr/src/lib/common/Makefile delete mode 100644 usr/src/lib/common/Makefile.com delete mode 100644 usr/src/lib/common/amd64/Makefile delete mode 100644 usr/src/lib/common/amd64/crt1.s delete mode 100644 usr/src/lib/common/amd64/crti.s delete mode 100644 usr/src/lib/common/amd64/crtn.s delete mode 100644 usr/src/lib/common/amd64/gcrt1.s delete mode 100644 usr/src/lib/common/common/values-Xa.c delete mode 100644 usr/src/lib/common/common/values-Xc.c delete mode 100644 usr/src/lib/common/common/values-Xs.c delete mode 100644 usr/src/lib/common/common/values-Xt.c delete mode 100644 usr/src/lib/common/common/values-xpg4.c delete mode 100644 usr/src/lib/common/common/values-xpg6.c delete mode 100644 usr/src/lib/common/i386/Makefile delete mode 100644 usr/src/lib/common/i386/crt1.s delete mode 100644 usr/src/lib/common/i386/crti.s delete mode 100644 usr/src/lib/common/i386/crtn.s delete mode 100644 usr/src/lib/common/i386/fsr.s delete mode 100644 usr/src/lib/common/i386/gcrt1.s delete mode 100644 usr/src/lib/common/sparc/Makefile delete mode 100644 usr/src/lib/common/sparc/crti.s delete mode 100644 usr/src/lib/common/sparc/crtn.s delete mode 100644 usr/src/lib/common/sparcv9/Makefile delete mode 100644 usr/src/lib/common/sparcv9/crti.s delete mode 100644 usr/src/lib/common/sparcv9/crtn.s create mode 100644 usr/src/lib/crt/Makefile create mode 100644 usr/src/lib/crt/Makefile.com create mode 100644 usr/src/lib/crt/amd64/Makefile create mode 100644 usr/src/lib/crt/amd64/crti.s create mode 100644 usr/src/lib/crt/amd64/crtn.s create mode 100644 usr/src/lib/crt/amd64/mach-crt1.s create mode 100644 usr/src/lib/crt/common/common-crt.c create mode 100644 usr/src/lib/crt/common/values-Xa.c create mode 100644 usr/src/lib/crt/common/values-Xc.c create mode 100644 usr/src/lib/crt/common/values-Xs.c create mode 100644 usr/src/lib/crt/common/values-Xt.c create mode 100644 usr/src/lib/crt/common/values-xpg4.c create mode 100644 usr/src/lib/crt/common/values-xpg6.c create mode 100644 usr/src/lib/crt/i386/Makefile create mode 100644 usr/src/lib/crt/i386/crti.s create mode 100644 usr/src/lib/crt/i386/crtn.s create mode 100644 usr/src/lib/crt/i386/fsr.s create mode 100644 usr/src/lib/crt/i386/mach-crt1.s create mode 100644 usr/src/lib/crt/sparc/Makefile create mode 100644 usr/src/lib/crt/sparc/crti.s create mode 100644 usr/src/lib/crt/sparc/crtn.s create mode 100644 usr/src/lib/crt/sparc/mach-crt1.s create mode 100644 usr/src/lib/crt/sparcv9/Makefile create mode 100644 usr/src/pkg/manifests/system-library-c-runtime.mf (limited to 'usr/src') 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/Makefile b/usr/src/lib/common/Makefile deleted file mode 100644 index 0cb21abafa..0000000000 --- a/usr/src/lib/common/Makefile +++ /dev/null @@ -1,48 +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. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.lib - -SUBDIRS = $(MACH) -$(BUILD64)SUBDIRS += $(MACH64) - -all := TARGET= all -install := TARGET= install -clean := TARGET= clean -clobber := TARGET= clobber - -.KEEP_STATE: - -all install clean clobber: $(SUBDIRS) - -lint: - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: diff --git a/usr/src/lib/common/Makefile.com b/usr/src/lib/common/Makefile.com deleted file mode 100644 index 76e86844bc..0000000000 --- a/usr/src/lib/common/Makefile.com +++ /dev/null @@ -1,77 +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 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 - -# include library definitions -include ../../Makefile.lib - -POST_PROCESS_O = $(PROCESS_COMMENT) $@ ; $(STRIP) -x $@ - -OBJECTS = $(VALUES) $(CRTI) $(CRTN) -$(INTEL_BLD)OBJECTS += $(CRT1) $(GCRT1) - -ROOTLIB= $(ROOT)/usr/lib -ROOTLIB64= $(ROOTLIB)/$(MACH64) -ROOTOBJECTS= $(OBJECTS:%=$(ROOTLIB)/%) -ROOTOBJECTS64= $(OBJECTS:%=$(ROOTLIB64)/%) - -ASFLAGS += -P -D__STDC__ -D_ASM -DPIC - -values-xpg6.o := CPPFLAGS += -I$(SRC)/lib/libc/inc -$(VALUES) := CFLAGS += $(C_PICFLAGS) -$(VALUES) := CFLAGS64 += $(C_PICFLAGS64) - -.KEEP_STATE: - -all: $(OBJECTS) - -clean clobber: - $(RM) $(OBJECTS) - -lint: - -%.o: ../common/%.c - $(COMPILE.c) -o $@ $< - $(POST_PROCESS_O) - -%.o: %.s - $(COMPILE.s) -o $@ $< - $(POST_PROCESS_O) - -# install rule for ROOTOBJECTS and ROOTOBJECTS64 - -$(ROOTLIB)/%.o: %.o - $(INS.file) - -$(ROOTLIB64)/%.o: %.o - $(INS.file) diff --git a/usr/src/lib/common/amd64/Makefile b/usr/src/lib/common/amd64/Makefile deleted file mode 100644 index 714b0b5281..0000000000 --- a/usr/src/lib/common/amd64/Makefile +++ /dev/null @@ -1,32 +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. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -install: $(ROOTOBJECTS64) 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/crti.s b/usr/src/lib/common/amd64/crti.s deleted file mode 100644 index 50ce02825d..0000000000 --- a/usr/src/lib/common/amd64/crti.s +++ /dev/null @@ -1,58 +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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "crti.s" - -/* - * 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 - */ - -/* - * _init function prologue - */ - .section .init,"ax" - .globl _init - .type _init,@function - .align 16 -_init: - pushq %rbp - movq %rsp, %rbp - -/* - * _fini function prologue - */ - .section .fini,"ax" - .globl _fini - .type _fini,@function - .align 16 -_fini: - pushq %rbp - movq %rsp, %rbp diff --git a/usr/src/lib/common/amd64/crtn.s b/usr/src/lib/common/amd64/crtn.s deleted file mode 100644 index 70b73b88dd..0000000000 --- a/usr/src/lib/common/amd64/crtn.s +++ /dev/null @@ -1,50 +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 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .file "crtn.s" - -/* - * 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 - */ - -/* - * _init function epilogue - */ - .section .init,"ax" - leave - ret - -/* - * _fini function epilogue - */ - .section .fini,"ax" - leave - ret 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/common/values-Xa.c b/usr/src/lib/common/common/values-Xa.c deleted file mode 100644 index fcd21db588..0000000000 --- a/usr/src/lib/common/common/values-Xa.c +++ /dev/null @@ -1,45 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -#include -#include - -/* - * variables which differ depending on the - * compilation mode - * - * ANSI conforming mode - * This file is linked into the a.out immediately following - * the startup routine if the -Xa compilation mode is selected - */ - -const enum version _lib_version = ansi_1; diff --git a/usr/src/lib/common/common/values-Xc.c b/usr/src/lib/common/common/values-Xc.c deleted file mode 100644 index 12d47c7ac0..0000000000 --- a/usr/src/lib/common/common/values-Xc.c +++ /dev/null @@ -1,45 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -#include -#include - -/* - * variables which differ depending on the - * compilation mode - * - * Strict ANSI mode - * This file is linked into the a.out immediately following - * the startup routine if the -Xc compilation mode is selected - */ - -const enum version _lib_version = strict_ansi; diff --git a/usr/src/lib/common/common/values-Xs.c b/usr/src/lib/common/common/values-Xs.c deleted file mode 100644 index 899669b6de..0000000000 --- a/usr/src/lib/common/common/values-Xs.c +++ /dev/null @@ -1,47 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -#include -#include - -/* - * variables which differ depending on the - * compilation mode - * - * C Issue 4.2 compatibility mode - * This file is linked into the a.out by default if - * no compilation mode was specified or if the -Xt option - * was specified - the linking occurs if there is an unresolved - * reference to _lib_version - */ - -const enum version _lib_version = c_issue_4; diff --git a/usr/src/lib/common/common/values-Xt.c b/usr/src/lib/common/common/values-Xt.c deleted file mode 100644 index 899669b6de..0000000000 --- a/usr/src/lib/common/common/values-Xt.c +++ /dev/null @@ -1,47 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -#include -#include - -/* - * variables which differ depending on the - * compilation mode - * - * C Issue 4.2 compatibility mode - * This file is linked into the a.out by default if - * no compilation mode was specified or if the -Xt option - * was specified - the linking occurs if there is an unresolved - * reference to _lib_version - */ - -const enum version _lib_version = c_issue_4; diff --git a/usr/src/lib/common/common/values-xpg4.c b/usr/src/lib/common/common/values-xpg4.c deleted file mode 100644 index d72bffa6c8..0000000000 --- a/usr/src/lib/common/common/values-xpg4.c +++ /dev/null @@ -1,36 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include -/* - * Setting thie value to 1 enables XPG4 mode for APIs - * which have differing runtime behaviour from XPG3 to XPG4. - * See usr/src/lib/libc/port/gen/xpg4.c for the default value. - */ - -int __xpg4 = 1; diff --git a/usr/src/lib/common/common/values-xpg6.c b/usr/src/lib/common/common/values-xpg6.c deleted file mode 100644 index ea46fd5439..0000000000 --- a/usr/src/lib/common/common/values-xpg6.c +++ /dev/null @@ -1,57 +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. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * __xpg6 (C99/SUSv3) was first introduced in Solaris 10. - * - * This file is NOT linked into libc. See xpg6.c. - * This value is linked into an application when the application is - * requesting conforming C99/SUSv3 behavior. This is usually done - * with the c99 utility. - * - * __xpg6 is used to control certain behaviors between the C99 standard, - * the SUSv3 standard, and Solaris. More explanation in inc/xpg6.h. - * The XPG6 C compiler utility (c99) will add an object file that contains an - * alternate definition for __xpg6. The symbol interposition provided - * by the linker will allow libc to find that symbol instead. - * - * Possible settings are available and documented in inc/xpg6.h. - */ - -/* - * This setting enables strictly conforming C99/SUSv3 behavior. - */ - -#include "xpg6.h" - -unsigned int __xpg6 = _C99SUSv3_mode_ON; - -/* - * Also turn on XPG4 mode. - */ -int __xpg4 = 1; diff --git a/usr/src/lib/common/i386/Makefile b/usr/src/lib/common/i386/Makefile deleted file mode 100644 index 68fee1b0a9..0000000000 --- a/usr/src/lib/common/i386/Makefile +++ /dev/null @@ -1,31 +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. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -install: $(ROOTOBJECTS) 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/crti.s b/usr/src/lib/common/i386/crti.s deleted file mode 100644 index 8f8a7ed477..0000000000 --- a/usr/src/lib/common/i386/crti.s +++ /dev/null @@ -1,86 +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. - */ -/* - * Copyright (c) 2013, Joyent, 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 - */ - - .file "crti.s" - -/* - * Note that when _init and _fini are called 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/crt1.s - */ - -/* - * _init function prologue - */ - .section .init,"ax" - .globl _init - .type _init,@function - .align 16 -_init: - pushl %ebp - movl %esp, %ebp - andl $-16,%esp - subl $12,%esp - pushl %ebx - call .L1 -.L1: popl %ebx - addl $_GLOBAL_OFFSET_TABLE_+[.-.L1], %ebx - -/* - * _fini function prologue - */ - .section .fini,"ax" - .globl _fini - .type _fini,@function - .align 16 -_fini: - pushl %ebp - movl %esp, %ebp - andl $-16,%esp - subl $12,%esp - pushl %ebx - call .L2 -.L2: popl %ebx - addl $_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx diff --git a/usr/src/lib/common/i386/crtn.s b/usr/src/lib/common/i386/crtn.s deleted file mode 100644 index 6e37e25a8f..0000000000 --- a/usr/src/lib/common/i386/crtn.s +++ /dev/null @@ -1,55 +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 - */ - .ident "%Z%%M% %I% %E% SMI" - .file "crtn.s" - -/* - * _init function epilogue - */ - .section .init,"ax" - - popl %ebx - leave - ret - -/* - * _fini function epilogue - */ - .section .fini,"ax" - - popl %ebx - leave - ret diff --git a/usr/src/lib/common/i386/fsr.s b/usr/src/lib/common/i386/fsr.s deleted file mode 100644 index 426d0266e2..0000000000 --- a/usr/src/lib/common/i386/fsr.s +++ /dev/null @@ -1,159 +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 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - - .ident "%Z%%M% %I% %E% SMI" - - .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): - * - * bit 0 - inexact trap - * bit 1 - division trap - * bit 2 - underflow trap - * bit 3 - overflow trap - * bit 4 - invalid trap - * - * to exception masks in the floating point control word - * - * bit 0 - invalid mask - * bit 2 - zero divide mask - * bit 3 - overflow mask - * bit 4 - underflow mask - * bit 5 - inexact mask - */ - .local trap_table - .type trap_table,@object -trap_table: - .byte 0b11111111 - .byte 0b11011111 - .byte 0b11111011 - .byte 0b11011011 - .byte 0b11101111 - .byte 0b11001111 - .byte 0b11101011 - .byte 0b11001011 - .byte 0b11110111 - .byte 0b11010111 - .byte 0b11110011 - .byte 0b11010011 - .byte 0b11100111 - .byte 0b11000111 - .byte 0b11100011 - .byte 0b11000011 - .byte 0b11111110 - .byte 0b11011110 - .byte 0b11111010 - .byte 0b11011010 - .byte 0b11101110 - .byte 0b11001110 - .byte 0b11101010 - .byte 0b11001010 - .byte 0b11110110 - .byte 0b11010110 - .byte 0b11110010 - .byte 0b11010010 - .byte 0b11100110 - .byte 0b11000110 - .byte 0b11100010 - .byte 0b11000010 - - .size trap_table,32 - - .section .text - .align 4 - - .globl __fsr - .type __fsr,@function -__fsr: - pushl %ebp - movl %esp,%ebp - pushl %edx - pushl %ecx - subl $4,%esp - - lea __fsr_init_value_ptr, %ecx - movl (%ecx),%ecx /* get the value set by CG */ - shrl $1,%ecx /* get rid of fns bit */ - cmpl $0,%ecx /* if remaining bits are zero */ - je 3f /* there's nothing to do */ - - fstcw 0(%esp) /* store the control word */ - - movl %ecx,%edx - andl $0x1f,%edx /* get the trap enable bits */ - movb trap_table(%edx),%al - andb %al,0(%esp) /* unmask the corresponding exceptions */ - - testl $0x200,%ecx /* test denormal trap enable */ - jz 1f /* skip if zero */ - - andb $0xfd,0(%esp) /* unmask denormal exception */ - -1: - movl %ecx,%edx - andl $0x60,%edx /* get the rounding direction */ - jz 1f /* skip if zero */ - - movl %edx,%eax /* exchange negative<->tozero */ - andl $0x20,%eax /* leaving nearest and positive */ - shll $1,%eax /* as is */ - xorl %eax,%edx - shll $5,%edx - andw $0xf3ff,0(%esp) /* update rounding direction */ - orw %dx,0(%esp) - -1: - andl $0x180,%ecx /* get the rounding precision */ - jz 1f /* skip if zero */ - - xorl $0x180,%ecx /* reverse bits */ - shll $1,%ecx - andw $0xfcff,0(%esp) /* update rounding precision */ - orw %cx,0(%esp) - -1: - fldcw 0(%esp) /* load the modified control word */ - -3: - addl $4,%esp - popl %ecx - popl %edx - popl %ebp - ret - - .size __fsr,[.-__fsr] 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/Makefile b/usr/src/lib/common/sparc/Makefile deleted file mode 100644 index 68fee1b0a9..0000000000 --- a/usr/src/lib/common/sparc/Makefile +++ /dev/null @@ -1,31 +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. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com - -install: $(ROOTOBJECTS) 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/sparcv9/Makefile b/usr/src/lib/common/sparcv9/Makefile deleted file mode 100644 index 714b0b5281..0000000000 --- a/usr/src/lib/common/sparcv9/Makefile +++ /dev/null @@ -1,32 +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. -# -# ident "%Z%%M% %I% %E% SMI" -# - -include ../Makefile.com -include ../../Makefile.lib.64 - -install: $(ROOTOBJECTS64) diff --git a/usr/src/lib/common/sparcv9/crti.s b/usr/src/lib/common/sparcv9/crti.s deleted file mode 100644 index c457355a1d..0000000000 --- a/usr/src/lib/common/sparcv9/crti.s +++ /dev/null @@ -1,59 +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 (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 - */ - - .file "crti.s" - -#include - -/* - * _init function prologue - */ - .section ".init" - .global _init - .type _init, #function - .align 4 -_init: - save %sp, -SA(MINFRAME), %sp - -/* - * _fini function prologue - */ - .section ".fini" - .global _fini - .type _fini, #function - .align 4 -_fini: - save %sp, -SA(MINFRAME), %sp diff --git a/usr/src/lib/common/sparcv9/crtn.s b/usr/src/lib/common/sparcv9/crtn.s deleted file mode 100644 index 002bd6f053..0000000000 --- a/usr/src/lib/common/sparcv9/crtn.s +++ /dev/null @@ -1,52 +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 (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 - */ - - .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/crt/Makefile b/usr/src/lib/crt/Makefile new file mode 100644 index 0000000000..57ce536003 --- /dev/null +++ b/usr/src/lib/crt/Makefile @@ -0,0 +1,45 @@ +# +# 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. +# + +include ../Makefile.lib + +SUBDIRS = $(MACH) +$(BUILD64)SUBDIRS += $(MACH64) + +all := TARGET= all +install := TARGET= install +clean := TARGET= clean +clobber := TARGET= clobber +lint := TARGET= lint + +.KEEP_STATE: + +all install clean clobber lint: $(SUBDIRS) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: diff --git a/usr/src/lib/crt/Makefile.com b/usr/src/lib/crt/Makefile.com new file mode 100644 index 0000000000..9ae8be2310 --- /dev/null +++ b/usr/src/lib/crt/Makefile.com @@ -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 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +CRTI = crti.o +CRTN = crtn.o +CRT1 = crt1.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) $(CRT1) $(CRTI) $(CRTN) + +ROOTLIB= $(ROOT)/usr/lib +ROOTLIB64= $(ROOTLIB)/$(MACH64) +ROOTOBJECTS= $(OBJECTS:%=$(ROOTLIB)/%) +ROOTOBJECTS64= $(OBJECTS:%=$(ROOTLIB64)/%) + +$(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-xpg6.lint := CPPFLAGS += -I$(SRC)/lib/libc/inc +$(COMMON_CRT) $(VALUES) := CFLAGS += $(C_PICFLAGS) +$(COMMON_CRT) $(VALUES) := CFLAGS64 += $(C_PICFLAGS64) + +.KEEP_STATE: + +all: $(OBJECTS) + +clean clobber: + $(RM) $(OBJECTS) + +%.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 $@ $< + $(POST_PROCESS_O) + +%.o: %.s + $(COMPILE.s) -o $@ $< + $(POST_PROCESS_O) + +%.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/crt/amd64/Makefile b/usr/src/lib/crt/amd64/Makefile new file mode 100644 index 0000000000..16967b67ff --- /dev/null +++ b/usr/src/lib/crt/amd64/Makefile @@ -0,0 +1,30 @@ +# +# 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. +# + +include ../Makefile.com +include ../../Makefile.lib.64 + +install: $(ROOTOBJECTS64) diff --git a/usr/src/lib/crt/amd64/crti.s b/usr/src/lib/crt/amd64/crti.s new file mode 100644 index 0000000000..14e71e03a5 --- /dev/null +++ b/usr/src/lib/crt/amd64/crti.s @@ -0,0 +1,58 @@ +/* + * 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 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .file "crti.s" + +/* + * 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 + */ + +/* + * _init function prologue + */ + .section .init,"ax" + .globl _init + .type _init,@function + .align 16 +_init: + pushq %rbp + movq %rsp, %rbp + +/* + * _fini function prologue + */ + .section .fini,"ax" + .globl _fini + .type _fini,@function + .align 16 +_fini: + pushq %rbp + movq %rsp, %rbp diff --git a/usr/src/lib/crt/amd64/crtn.s b/usr/src/lib/crt/amd64/crtn.s new file mode 100644 index 0000000000..70b73b88dd --- /dev/null +++ b/usr/src/lib/crt/amd64/crtn.s @@ -0,0 +1,50 @@ +/* + * 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 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + .file "crtn.s" + +/* + * 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 + */ + +/* + * _init function epilogue + */ + .section .init,"ax" + leave + ret + +/* + * _fini function epilogue + */ + .section .fini,"ax" + leave + ret 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 + + .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 +#include + +#include +#include +#include + +#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/crt/common/values-Xa.c b/usr/src/lib/crt/common/values-Xa.c new file mode 100644 index 0000000000..041a6dc8b0 --- /dev/null +++ b/usr/src/lib/crt/common/values-Xa.c @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + + +#include +#include + +/* + * variables which differ depending on the + * compilation mode + * + * ANSI conforming mode + * This file is linked into the a.out immediately following + * the startup routine if the -Xa compilation mode is selected + */ + +const enum version _lib_version = ansi_1; diff --git a/usr/src/lib/crt/common/values-Xc.c b/usr/src/lib/crt/common/values-Xc.c new file mode 100644 index 0000000000..ef70ae97a7 --- /dev/null +++ b/usr/src/lib/crt/common/values-Xc.c @@ -0,0 +1,43 @@ +/* + * 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. + */ + +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + + +#include +#include + +/* + * variables which differ depending on the + * compilation mode + * + * Strict ANSI mode + * This file is linked into the a.out immediately following + * the startup routine if the -Xc compilation mode is selected + */ + +const enum version _lib_version = strict_ansi; diff --git a/usr/src/lib/crt/common/values-Xs.c b/usr/src/lib/crt/common/values-Xs.c new file mode 100644 index 0000000000..b876d90724 --- /dev/null +++ b/usr/src/lib/crt/common/values-Xs.c @@ -0,0 +1,45 @@ +/* + * 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. + */ + +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + + +#include +#include + +/* + * variables which differ depending on the + * compilation mode + * + * C Issue 4.2 compatibility mode + * This file is linked into the a.out by default if + * no compilation mode was specified or if the -Xt option + * was specified - the linking occurs if there is an unresolved + * reference to _lib_version + */ + +const enum version _lib_version = c_issue_4; diff --git a/usr/src/lib/crt/common/values-Xt.c b/usr/src/lib/crt/common/values-Xt.c new file mode 100644 index 0000000000..b876d90724 --- /dev/null +++ b/usr/src/lib/crt/common/values-Xt.c @@ -0,0 +1,45 @@ +/* + * 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. + */ + +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + + +#include +#include + +/* + * variables which differ depending on the + * compilation mode + * + * C Issue 4.2 compatibility mode + * This file is linked into the a.out by default if + * no compilation mode was specified or if the -Xt option + * was specified - the linking occurs if there is an unresolved + * reference to _lib_version + */ + +const enum version _lib_version = c_issue_4; diff --git a/usr/src/lib/crt/common/values-xpg4.c b/usr/src/lib/crt/common/values-xpg4.c new file mode 100644 index 0000000000..54b5afc883 --- /dev/null +++ b/usr/src/lib/crt/common/values-xpg4.c @@ -0,0 +1,34 @@ +/* + * 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. + */ + +#include +/* + * Setting thie value to 1 enables XPG4 mode for APIs + * which have differing runtime behaviour from XPG3 to XPG4. + * See usr/src/lib/libc/port/gen/xpg4.c for the default value. + */ + +int __xpg4 = 1; diff --git a/usr/src/lib/crt/common/values-xpg6.c b/usr/src/lib/crt/common/values-xpg6.c new file mode 100644 index 0000000000..2e9e64efc2 --- /dev/null +++ b/usr/src/lib/crt/common/values-xpg6.c @@ -0,0 +1,55 @@ +/* + * 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. + */ + +/* + * __xpg6 (C99/SUSv3) was first introduced in Solaris 10. + * + * This file is NOT linked into libc. See xpg6.c. + * This value is linked into an application when the application is + * requesting conforming C99/SUSv3 behavior. This is usually done + * with the c99 utility. + * + * __xpg6 is used to control certain behaviors between the C99 standard, + * the SUSv3 standard, and Solaris. More explanation in inc/xpg6.h. + * The XPG6 C compiler utility (c99) will add an object file that contains an + * alternate definition for __xpg6. The symbol interposition provided + * by the linker will allow libc to find that symbol instead. + * + * Possible settings are available and documented in inc/xpg6.h. + */ + +/* + * This setting enables strictly conforming C99/SUSv3 behavior. + */ + +#include "xpg6.h" + +unsigned int __xpg6 = _C99SUSv3_mode_ON; + +/* + * Also turn on XPG4 mode. + */ +int __xpg4 = 1; diff --git a/usr/src/lib/crt/i386/Makefile b/usr/src/lib/crt/i386/Makefile new file mode 100644 index 0000000000..5affa893b7 --- /dev/null +++ b/usr/src/lib/crt/i386/Makefile @@ -0,0 +1,29 @@ +# +# 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. +# + +include ../Makefile.com + +install: $(ROOTOBJECTS) diff --git a/usr/src/lib/crt/i386/crti.s b/usr/src/lib/crt/i386/crti.s new file mode 100644 index 0000000000..8e630511ca --- /dev/null +++ b/usr/src/lib/crt/i386/crti.s @@ -0,0 +1,86 @@ +/* + * 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. + */ +/* + * Copyright (c) 2013, Joyent, 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 + */ + + .file "crti.s" + +/* + * Note that when _init and _fini are called 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/mach-crt1.s + */ + +/* + * _init function prologue + */ + .section .init,"ax" + .globl _init + .type _init,@function + .align 16 +_init: + pushl %ebp + movl %esp, %ebp + andl $-16,%esp + subl $12,%esp + pushl %ebx + call .L1 +.L1: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L1], %ebx + +/* + * _fini function prologue + */ + .section .fini,"ax" + .globl _fini + .type _fini,@function + .align 16 +_fini: + pushl %ebp + movl %esp, %ebp + andl $-16,%esp + subl $12,%esp + pushl %ebx + call .L2 +.L2: popl %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx diff --git a/usr/src/lib/crt/i386/crtn.s b/usr/src/lib/crt/i386/crtn.s new file mode 100644 index 0000000000..413c102006 --- /dev/null +++ b/usr/src/lib/crt/i386/crtn.s @@ -0,0 +1,54 @@ +/* + * 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 + */ + .file "crtn.s" + +/* + * _init function epilogue + */ + .section .init,"ax" + + popl %ebx + leave + ret + +/* + * _fini function epilogue + */ + .section .fini,"ax" + + popl %ebx + leave + ret diff --git a/usr/src/lib/crt/i386/fsr.s b/usr/src/lib/crt/i386/fsr.s new file mode 100644 index 0000000000..bafc28042f --- /dev/null +++ b/usr/src/lib/crt/i386/fsr.s @@ -0,0 +1,154 @@ +/* + * 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. + */ + +#include + + .file "fsr.s" + + .section .data + .align 4 + +/* + * The following table maps trap enable bits in __fsr_init_value + * (after shifting right one bit): + * + * bit 0 - inexact trap + * bit 1 - division trap + * bit 2 - underflow trap + * bit 3 - overflow trap + * bit 4 - invalid trap + * + * to exception masks in the floating point control word + * + * bit 0 - invalid mask + * bit 2 - zero divide mask + * bit 3 - overflow mask + * bit 4 - underflow mask + * bit 5 - inexact mask + */ + .local trap_table + .type trap_table,@object +trap_table: + .byte 0b11111111 + .byte 0b11011111 + .byte 0b11111011 + .byte 0b11011011 + .byte 0b11101111 + .byte 0b11001111 + .byte 0b11101011 + .byte 0b11001011 + .byte 0b11110111 + .byte 0b11010111 + .byte 0b11110011 + .byte 0b11010011 + .byte 0b11100111 + .byte 0b11000111 + .byte 0b11100011 + .byte 0b11000011 + .byte 0b11111110 + .byte 0b11011110 + .byte 0b11111010 + .byte 0b11011010 + .byte 0b11101110 + .byte 0b11001110 + .byte 0b11101010 + .byte 0b11001010 + .byte 0b11110110 + .byte 0b11010110 + .byte 0b11110010 + .byte 0b11010010 + .byte 0b11100110 + .byte 0b11000110 + .byte 0b11100010 + .byte 0b11000010 + + .size trap_table,32 + +ENTRY_NP(__fsr) + pushl %ebp + movl %esp,%ebp + pushl %edx + pushl %ecx + pushl %ebx + subl $4,%esp + + /* 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 */ + + fstcw 0(%esp) /* store the control word */ + + movl %ecx,%edx + andl $0x1f,%edx /* get the trap enable bits */ + 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 */ + jz 1f /* skip if zero */ + + andb $0xfd,0(%esp) /* unmask denormal exception */ + +1: + movl %ecx,%edx + andl $0x60,%edx /* get the rounding direction */ + jz 1f /* skip if zero */ + + movl %edx,%eax /* exchange negative<->tozero */ + andl $0x20,%eax /* leaving nearest and positive */ + shll $1,%eax /* as is */ + xorl %eax,%edx + shll $5,%edx + andw $0xf3ff,0(%esp) /* update rounding direction */ + orw %dx,0(%esp) + +1: + andl $0x180,%ecx /* get the rounding precision */ + jz 1f /* skip if zero */ + + xorl $0x180,%ecx /* reverse bits */ + shll $1,%ecx + andw $0xfcff,0(%esp) /* update rounding precision */ + orw %cx,0(%esp) + +1: + fldcw 0(%esp) /* load the modified control word */ + +3: + addl $4,%esp + popl %ebx + popl %ecx + popl %edx + popl %ebp + ret +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 + + .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/crt/sparc/Makefile b/usr/src/lib/crt/sparc/Makefile new file mode 100644 index 0000000000..5affa893b7 --- /dev/null +++ b/usr/src/lib/crt/sparc/Makefile @@ -0,0 +1,29 @@ +# +# 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. +# + +include ../Makefile.com + +install: $(ROOTOBJECTS) diff --git a/usr/src/lib/crt/sparc/crti.s b/usr/src/lib/crt/sparc/crti.s new file mode 100644 index 0000000000..c457355a1d --- /dev/null +++ b/usr/src/lib/crt/sparc/crti.s @@ -0,0 +1,59 @@ +/* + * 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 (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 + */ + + .file "crti.s" + +#include + +/* + * _init function prologue + */ + .section ".init" + .global _init + .type _init, #function + .align 4 +_init: + save %sp, -SA(MINFRAME), %sp + +/* + * _fini function prologue + */ + .section ".fini" + .global _fini + .type _fini, #function + .align 4 +_fini: + save %sp, -SA(MINFRAME), %sp diff --git a/usr/src/lib/crt/sparc/crtn.s b/usr/src/lib/crt/sparc/crtn.s new file mode 100644 index 0000000000..002bd6f053 --- /dev/null +++ b/usr/src/lib/crt/sparc/crtn.s @@ -0,0 +1,52 @@ +/* + * 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 (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 + */ + + .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/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 +#include + + .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/crt/sparcv9/Makefile b/usr/src/lib/crt/sparcv9/Makefile new file mode 100644 index 0000000000..16967b67ff --- /dev/null +++ b/usr/src/lib/crt/sparcv9/Makefile @@ -0,0 +1,30 @@ +# +# 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. +# + +include ../Makefile.com +include ../../Makefile.lib.64 + +install: $(ROOTOBJECTS64) 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 -- cgit v1.2.3