Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ld.elf_so Add code to use the kernel provided page s...
details: https://anonhg.NetBSD.org/src/rev/9039c8fede41
branches: trunk
changeset: 472026:9039c8fede41
user: ws <ws%NetBSD.org@localhost>
date: Sun Apr 18 19:40:06 1999 +0000
description:
Add code to use the kernel provided page size.
Enable this on the powerpc only for now.
diffstat:
libexec/ld.elf_so/arch/powerpc/Makefile.inc | 4 ++--
libexec/ld.elf_so/arch/powerpc/rtld_start.S | 7 +------
libexec/ld.elf_so/rtld.c | 21 ++++++++++++++++++++-
libexec/ld.elf_so/rtld.h | 17 +++++++++++++----
4 files changed, 36 insertions(+), 13 deletions(-)
diffs (129 lines):
diff -r 6608067e4dee -r 9039c8fede41 libexec/ld.elf_so/arch/powerpc/Makefile.inc
--- a/libexec/ld.elf_so/arch/powerpc/Makefile.inc Sun Apr 18 15:43:21 1999 +0000
+++ b/libexec/ld.elf_so/arch/powerpc/Makefile.inc Sun Apr 18 19:40:06 1999 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.2 1999/01/16 14:59:04 christos Exp $
+# $NetBSD: Makefile.inc,v 1.3 1999/04/18 19:40:07 ws Exp $
SRCS+= rtld_start.S ppc_reloc.c
-CPPFLAGS+= -fpic -msoft-float -DELFSIZE=32 -I${.CURDIR}
+CPPFLAGS+= -fpic -msoft-float -DELFSIZE=32 -DVARPSZ -I${.CURDIR}
LDFLAGS+= -Bshareable -Bsymbolic -e .rtld_start
LDFLAGS+= --script ${.CURDIR}/arch/powerpc/ld.so.script
diff -r 6608067e4dee -r 9039c8fede41 libexec/ld.elf_so/arch/powerpc/rtld_start.S
--- a/libexec/ld.elf_so/arch/powerpc/rtld_start.S Sun Apr 18 15:43:21 1999 +0000
+++ b/libexec/ld.elf_so/arch/powerpc/rtld_start.S Sun Apr 18 19:40:06 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld_start.S,v 1.1 1998/11/24 11:34:31 tsubai Exp $ */
+/* $NetBSD: rtld_start.S,v 1.2 1999/04/18 19:40:07 ws Exp $ */
/*-
* Copyright (C) 1998 Tsubai Masanari
@@ -50,11 +50,6 @@
lwz 4,0(3)
add 3,3,4 # r3 = _GLOBAL_OFFSET_TABLE_ - 4
- dcbst 0,3 # sync i-cache with d-cache
- sync
- icbi 0,3
- isync
-
addi 11,3,4 # r11 = (real) GOT
lwz 10,_GLOBAL_OFFSET_TABLE_@got(11)
# the linker thought GOT were ...
diff -r 6608067e4dee -r 9039c8fede41 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c Sun Apr 18 15:43:21 1999 +0000
+++ b/libexec/ld.elf_so/rtld.c Sun Apr 18 19:40:06 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.c,v 1.17 1999/03/08 10:44:25 kleink Exp $ */
+/* $NetBSD: rtld.c,v 1.18 1999/04/18 19:40:06 ws Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -84,6 +84,9 @@
Obj_Entry *_rtld_objmain; /* The main program shared object */
Obj_Entry _rtld_objself; /* The dynamic linker shared object */
char _rtld_path[] = _PATH_RTLD;
+#ifdef VARPSZ
+int _rtld_pagesz; /* Page size, as provided by kernel */
+#endif
Search_Path *_rtld_paths;
/*
@@ -241,6 +244,9 @@
{
const AuxInfo *pAUX_base, *pAUX_entry, *pAUX_execfd, *pAUX_phdr,
*pAUX_phent, *pAUX_phnum;
+#ifdef VARPSZ
+ const AuxInfo *pAUX_pagesz;
+#endif
char **env;
const AuxInfo *aux;
const AuxInfo *auxp;
@@ -284,6 +290,9 @@
/* Digest the auxiliary vector. */
pAUX_base = pAUX_entry = pAUX_execfd = NULL;
pAUX_phdr = pAUX_phent = pAUX_phnum = NULL;
+#ifdef VARPSZ
+ pAUX_pagesz = NULL;
+#endif
for (auxp = aux; auxp->au_id != AUX_null; ++auxp) {
switch (auxp->au_id) {
case AUX_base:
@@ -304,6 +313,11 @@
case AUX_phnum:
pAUX_phnum = auxp;
break;
+#ifdef VARPSZ
+ case AUX_pagesz:
+ pAUX_pagesz = auxp;
+ break;
+#endif
}
}
@@ -311,6 +325,11 @@
assert(pAUX_base != NULL);
_rtld_init((caddr_t) pAUX_base->au_v);
+#ifdef VARPSZ
+ assert(pAUX_pagesz != NULL);
+ _rtld_pagesz = (int)pAUX_pagesz->au_v;
+#endif
+
#ifdef RTLD_DEBUG
dbg(("_ctype_ is %p\n", _ctype_));
#endif
diff -r 6608067e4dee -r 9039c8fede41 libexec/ld.elf_so/rtld.h
--- a/libexec/ld.elf_so/rtld.h Sun Apr 18 15:43:21 1999 +0000
+++ b/libexec/ld.elf_so/rtld.h Sun Apr 18 19:40:06 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.h,v 1.9 1999/03/19 18:25:57 kleink Exp $ */
+/* $NetBSD: rtld.h,v 1.10 1999/04/18 19:40:06 ws Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -51,10 +51,19 @@
#define SVR4_LIBDIRLEN (sizeof SVR4_LIBDIR - 1)
#ifndef PAGESIZE
-# ifndef __sparc__
-# define PAGESIZE CLBYTES
+# ifdef VARPSZ
+extern int _rtld_pagesz;
+# ifdef RTLD_DEBUG
+# define PAGESIZE (assert(_rtld_pagesz), _rtld_pagesz)
+# else
+# define PAGESIZE _rtld_pagesz
+# endif
# else
-# define PAGESIZE 8192 /* NPBG is not constant! */
+# ifndef __sparc__
+# define PAGESIZE CLBYTES
+# else
+# define PAGESIZE 8192 /* NPBG is not constant! */
+# endif
# endif
#endif
Home |
Main Index |
Thread Index |
Old Index