summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/sparc')
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com41
-rw-r--r--usr/src/lib/libc/sparc/crt/_rtboot.s28
-rw-r--r--usr/src/lib/libc/sparc/crt/_rtld.c14
-rw-r--r--usr/src/lib/libc/sparc/crt/alias_boot.h15
4 files changed, 40 insertions, 58 deletions
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index a7d66be272..67d166fa7c 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -155,19 +155,14 @@ GENOBJS= \
# sysobjs that contain large-file interfaces
COMSYSOBJS64= \
- creat64.o \
- fstat64.o \
fstatvfs64.o \
getdents64.o \
getrlimit64.o \
lseek64.o \
- lstat64.o \
mmap64.o \
- open64.o \
pread64.o \
pwrite64.o \
setrlimit64.o \
- stat64.o \
statvfs64.o
SYSOBJS64=
@@ -204,7 +199,6 @@ COMSYSOBJS= \
_so_socket.o \
_so_socketpair.o \
_sockconfig.o \
- access.o \
acct.o \
acl.o \
adjtime.o \
@@ -212,23 +206,17 @@ COMSYSOBJS= \
brk.o \
chdir.o \
chmod.o \
- chown.o \
chroot.o \
cladm.o \
close.o \
- creat.o \
- dup.o \
execve.o \
exit.o \
facl.o \
fchdir.o \
fchmod.o \
- fchown.o \
fchroot.o \
- fcntl.o \
fdsync.o \
fpathconf.o \
- fstat.o \
fstatfs.o \
fstatvfs.o \
getcpuid.o \
@@ -250,11 +238,9 @@ COMSYSOBJS= \
ioctl.o \
kaio.o \
kill.o \
- lchown.o \
link.o \
llseek.o \
lseek.o \
- lstat.o \
memcntl.o \
mincore.o \
mkdir.o \
@@ -268,7 +254,6 @@ COMSYSOBJS= \
nice.o \
ntp_adjtime.o \
ntp_gettime.o \
- open.o \
p_online.o \
pathconf.o \
pause.o \
@@ -285,9 +270,7 @@ COMSYSOBJS= \
read.o \
readlink.o \
readv.o \
- rename.o \
resolvepath.o \
- rmdir.o \
seteguid.o \
setgid.o \
setgroups.o \
@@ -299,7 +282,6 @@ COMSYSOBJS= \
sigprocmsk.o \
sigsendset.o \
sigsuspend.o \
- stat.o \
statfs.o \
statvfs.o \
stty.o \
@@ -313,7 +295,6 @@ COMSYSOBJS= \
ulimit.o \
umask.o \
umount2.o \
- unlink.o \
utssys.o \
uucopy.o \
vhangup.o \
@@ -435,7 +416,7 @@ PORTGEN= \
dirname.o \
div.o \
drand48.o \
- dup2.o \
+ dup.o \
env_data.o \
err.o \
errno.o \
@@ -841,29 +822,27 @@ UNWINDASMOBJS= \
# objects that implement the transitional large file API
PORTSYS64= \
- fstatat64.o \
lockf64.o \
- openat64.o
+ stat64.o
PORTSYS= \
_autofssys.o \
+ access.o \
acctctl.o \
bsd_signal.o \
+ chown.o \
corectl.o \
exacctsys.o \
execl.o \
execle.o \
execv.o \
- fsmisc.o \
- fstatat.o \
+ fcntl.o \
getpagesizes.o \
getpeerucred.o \
inst_sync.o \
issetugid.o \
label.o \
- libc_fcntl.o \
libc_link.o \
- libc_open.o \
lockf.o \
lwp.o \
lwp_cond.o \
@@ -872,12 +851,13 @@ PORTSYS= \
meminfosys.o \
msgsys.o \
nfssys.o \
- openat.o \
+ open.o \
pgrpsys.o \
posix_sigwait.o \
ppriv.o \
psetsys.o \
rctlsys.o \
+ rename.o \
sbrk.o \
semsys.o \
set_errno.o \
@@ -888,10 +868,12 @@ PORTSYS= \
signal.o \
sigpending.o \
sigstack.o \
+ stat.o \
tasksys.o \
time.o \
time_util.o \
ucontext.o \
+ unlink.o \
ustat.o \
utimesys.o \
zone.o
@@ -1002,6 +984,11 @@ CPPFLAGS= -D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
ASFLAGS= $(EXTN_ASFLAGS) -K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
+# As a favor to the dtrace syscall provider, libc still calls the
+# old syscall traps that have been obsoleted by the *at() interfaces.
+# Delete this to compile libc using only the new *at() system call traps
+CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
+
# Conditionally add support for making |wordexp()| check whether
# /usr/bin/ksh is ksh93 or not
include $(LIBCDIR)/../../Makefile.ksh93switch
diff --git a/usr/src/lib/libc/sparc/crt/_rtboot.s b/usr/src/lib/libc/sparc/crt/_rtboot.s
index 5ae8505d9a..7764d40507 100644
--- a/usr/src/lib/libc/sparc/crt/_rtboot.s
+++ b/usr/src/lib/libc/sparc/crt/_rtboot.s
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,13 +18,12 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
-#ident "%Z%%M% %I% %E% SMI"
-
.file "_rtboot.s"
! Bootstrap routine for alias ld.so. Control arrives here either directly
@@ -78,8 +76,8 @@
.global __rtboot
.local __rtld
.local s.LDSO, s.ZERO
- .local f.PANIC, f.OPEN, f.MMAP, f.FSTAT, f.SYSCONFIG, f.CLOSE, f.EXIT
- .local f.MUNMAP
+ .local f.PANIC, f.OPENAT, f.MMAP, f.FSTATAT, f.SYSCONFIG
+ .local f.CLOSE, f.EXIT, f.MUNMAP
.type __rtboot, #function
.align 4
@@ -138,9 +136,9 @@ __rtboot:
SI(ZERO)
SI(EMPTY)
FI(PANIC)
- FI(OPEN)
+ FI(OPENAT)
FI(MMAP)
- FI(FSTAT)
+ FI(FSTATAT)
FI(SYSCONFIG)
FI(CLOSE)
FI(MUNMAP)
@@ -179,9 +177,9 @@ f.PANIC:
ba f.EXIT ! leave
nop
-f.OPEN:
+f.OPENAT:
ba __syscall
- mov SYS_open, %g1
+ mov SYS_openat, %g1
f.MMAP:
sethi %hi(0x80000000), %g1 ! MAP_NEW
@@ -209,9 +207,9 @@ f.CLOSE:
ba __syscall
mov SYS_close, %g1
-f.FSTAT:
+f.FSTATAT:
ba __syscall
- mov SYS_fstat, %g1
+ mov SYS_fstatat, %g1
f.SYSCONFIG:
ba __syscall
diff --git a/usr/src/lib/libc/sparc/crt/_rtld.c b/usr/src/lib/libc/sparc/crt/_rtld.c
index 50647dd10c..132aad09c0 100644
--- a/usr/src/lib/libc/sparc/crt/_rtld.c
+++ b/usr/src/lib/libc/sparc/crt/_rtld.c
@@ -20,12 +20,10 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Redirection ld.so. Based on the 4.x binary compatibility ld.so, used
* to redirect aliases for ld.so to the real one.
@@ -56,10 +54,10 @@
#define LDSO strings[LDSO_S]
#define ZERO strings[ZERO_S]
#define CLOSE (*(funcs[CLOSE_F]))
-#define FSTAT (*(funcs[FSTAT_F]))
+#define FSTATAT (*(funcs[FSTATAT_F]))
#define MMAP (*(funcs[MMAP_F]))
#define MUNMAP (*(funcs[MUNMAP_F]))
-#define OPEN (*(funcs[OPEN_F]))
+#define OPENAT (*(funcs[OPENAT_F]))
#define PANIC (*(funcs[PANIC_F]))
#define SYSCONFIG (*(funcs[SYSCONFIG_F]))
@@ -133,9 +131,9 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])())
* data structures. Further mappings will actually establish the
* program in the address space.
*/
- if ((ldfd = OPEN(LDSO, O_RDONLY)) == -1)
+ if ((ldfd = OPENAT(AT_FDCWD, LDSO, O_RDONLY)) == -1)
PANIC(program_name);
- if (FSTAT(ldfd, &sb) == -1)
+ if (FSTATAT(ldfd, NULL, &sb, 0) == -1)
PANIC(program_name);
ehdr = (Elf32_Ehdr *)MMAP(0, sb.st_size, PROT_READ | PROT_EXEC,
MAP_SHARED, ldfd, 0);
@@ -291,7 +289,7 @@ __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])())
j = (faddr + pptr->p_vaddr + pptr->p_memsz) - zaddr;
if (j > 0) {
if (dzfd == 0) {
- dzfd = OPEN(ZERO, O_RDWR);
+ dzfd = OPENAT(AT_FDCWD, ZERO, O_RDWR);
if (dzfd == -1)
PANIC(program_name);
}
diff --git a/usr/src/lib/libc/sparc/crt/alias_boot.h b/usr/src/lib/libc/sparc/crt/alias_boot.h
index 754d480841..e2a96f933a 100644
--- a/usr/src/lib/libc/sparc/crt/alias_boot.h
+++ b/usr/src/lib/libc/sparc/crt/alias_boot.h
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,15 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1991 Sun Microsystems, Inc.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#ifndef _ALIAS_BOOT_H
#define _ALIAS_BOOT_H
-#ident "%Z%%M% %I% %E% SMI"
-
/*
* Offsets for string constants used in alias bootstrap.
*/
@@ -40,9 +39,9 @@
* Offsets for function pointers used in alias bootstrap.
*/
#define PANIC_F 0 /* panic() */
-#define OPEN_F 1 /* open() */
+#define OPENAT_F 1 /* openat() */
#define MMAP_F 2 /* mmap() */
-#define FSTAT_F 3 /* fstat() */
+#define FSTATAT_F 3 /* fstatat() */
#define SYSCONFIG_F 4 /* sysconfig() */
#define CLOSE_F 5 /* close() */
#define MUNMAP_F 6 /* munmap() */