Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Enable TLS for alpha - a 2nd class^Wtier system in pookaBSD^...
details: https://anonhg.NetBSD.org/src/rev/f2e0a45b999e
branches: trunk
changeset: 763711:f2e0a45b999e
user: skrll <skrll%NetBSD.org@localhost>
date: Thu Mar 31 15:30:31 2011 +0000
description:
Enable TLS for alpha - a 2nd class^Wtier system in pookaBSD^WNetBSD
alpha_reloc.c diff from joerg on port-alpha.
diffstat:
libexec/ld.elf_so/arch/alpha/alpha_reloc.c | 63 +++++++++++++++++++++++++++++-
sys/arch/alpha/include/types.h | 6 +-
2 files changed, 64 insertions(+), 5 deletions(-)
diffs (108 lines):
diff -r fd58981ae70e -r f2e0a45b999e libexec/ld.elf_so/arch/alpha/alpha_reloc.c
--- a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c Thu Mar 31 13:07:20 2011 +0000
+++ b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c Thu Mar 31 15:30:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha_reloc.c,v 1.39 2011/03/25 18:07:04 joerg Exp $ */
+/* $NetBSD: alpha_reloc.c,v 1.40 2011/03/31 15:30:31 skrll Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -62,10 +62,11 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: alpha_reloc.c,v 1.39 2011/03/25 18:07:04 joerg Exp $");
+__RCSID("$NetBSD: alpha_reloc.c,v 1.40 2011/03/31 15:30:31 skrll Exp $");
#endif /* not lint */
#include <sys/types.h>
+#include <sys/tls.h>
#include <string.h>
#include "rtld.h"
@@ -261,6 +262,64 @@
rdbg(("COPY (avoid in main)"));
break;
+ case R_TYPE(TPREL64):
+ def = _rtld_find_symdef(symnum, obj, &defobj, false);
+ if (def == NULL)
+ return -1;
+
+ if (!defobj->tls_done &&
+ _rtld_tls_offset_allocate(obj))
+ return -1;
+
+ tmp = (Elf64_Addr)(def->st_value +
+ sizeof(struct tls_tcb) + defobj->tlsoffset +
+ rela->r_addend);
+
+ if (__predict_true(RELOC_ALIGNED_P(where)))
+ *where = tmp;
+ else
+ store_ptr(where, tmp);
+
+ rdbg(("TPREL64 %s in %s --> %p",
+ obj->strtab + obj->symtab[symnum].st_name,
+ obj->path, (void *)*where));
+
+ break;
+
+ case R_TYPE(DTPMOD64):
+ def = _rtld_find_symdef(symnum, obj, &defobj, false);
+ if (def == NULL)
+ return -1;
+
+ tmp = (Elf64_Addr)defobj->tlsindex;
+ if (__predict_true(RELOC_ALIGNED_P(where)))
+ *where = tmp;
+ else
+ store_ptr(where, tmp);
+
+ rdbg(("DTPMOD64 %s in %s --> %p",
+ obj->strtab + obj->symtab[symnum].st_name,
+ obj->path, (void *)*where));
+
+ break;
+
+ case R_TYPE(DTPREL64):
+ def = _rtld_find_symdef(symnum, obj, &defobj, false);
+ if (def == NULL)
+ return -1;
+
+ tmp = (Elf64_Addr)(def->st_value + rela->r_addend);
+ if (__predict_true(RELOC_ALIGNED_P(where)))
+ *where = tmp;
+ else
+ store_ptr(where, tmp);
+
+ rdbg(("DTPREL64 %s in %s --> %p",
+ obj->strtab + obj->symtab[symnum].st_name,
+ obj->path, (void *)*where));
+
+ break;
+
default:
rdbg(("sym = %lu, type = %lu, offset = %p, "
"addend = %p, contents = %p, symbol = %s",
diff -r fd58981ae70e -r f2e0a45b999e sys/arch/alpha/include/types.h
--- a/sys/arch/alpha/include/types.h Thu Mar 31 13:07:20 2011 +0000
+++ b/sys/arch/alpha/include/types.h Thu Mar 31 15:30:31 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.44 2011/02/24 04:28:44 joerg Exp $ */
+/* $NetBSD: types.h,v 1.45 2011/03/31 15:30:31 skrll Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -76,9 +76,9 @@
#define __HAVE_AST_PERPROC
#define __HAVE_ATOMIC64_OPS
#define __HAVE_CPU_LWP_SETPRIVATE
-#if 0
#define __HAVE___LWP_GETPRIVATE_FAST
-#endif
+#define __HAVE_COMMON___TLS_GET_ADDR
+#define __HAVE_TLS_VARIANT_I
#if defined(_KERNEL)
#define __HAVE_RAS
Home |
Main Index |
Thread Index |
Old Index