Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/librumpuser Decide ET_DYN behavior based on __GLIBC__ in...
details: https://anonhg.NetBSD.org/src/rev/efba8fcea1b4
branches: trunk
changeset: 788950:efba8fcea1b4
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Jul 30 18:48:51 2013 +0000
description:
Decide ET_DYN behavior based on __GLIBC__ instead of __linux__,
e.g. musl libc doesn't follow glibc behavior.
per discussions with a number of people
diffstat:
lib/librumpuser/rumpuser_dl.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (42 lines):
diff -r c8d58e750a3a -r efba8fcea1b4 lib/librumpuser/rumpuser_dl.c
--- a/lib/librumpuser/rumpuser_dl.c Tue Jul 30 17:22:31 2013 +0000
+++ b/lib/librumpuser/rumpuser_dl.c Tue Jul 30 18:48:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser_dl.c,v 1.19 2013/06/04 15:17:28 pooka Exp $ */
+/* $NetBSD: rumpuser_dl.c,v 1.20 2013/07/30 18:48:51 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -40,7 +40,7 @@
#include "rumpuser_port.h"
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser_dl.c,v 1.19 2013/06/04 15:17:28 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_dl.c,v 1.20 2013/07/30 18:48:51 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -144,17 +144,20 @@
/*
* On NetBSD, the dynamic section pointer values seem to be relative to
- * the address the dso is mapped at. On Linux, they seem to contain
+ * the address the dso is mapped at. On glibc, they seem to contain
* the absolute address. I couldn't find anything definite from a quick
* read of the standard and therefore I will not go and figure beyond ifdef.
- * On Solaris and DragonFly, the main object works differently ... uuuuh.
+ * On Solaris and DragonFly / FreeBSD, the main object works differently
+ * ... uuuuh.
*/
-#if defined(__linux__)
+#if defined(__GLIBC__)
+/* XXX: not true for e.g. MIPS, but we'll cross that hurdle later */
#define adjptr(_map_, _ptr_) ((void *)(_ptr_))
#elif defined(__sun__) || defined(__DragonFly__) || defined(__FreeBSD__)
#define adjptr(_map_, _ptr_) \
(ismainobj ? (void *)(_ptr_) : (void *)(_map_->l_addr + (_ptr_)))
#else
+/* NetBSD and some others, e.g. Linux + musl-libc */
#define adjptr(_map_, _ptr_) ((void *)(_map_->l_addr + (_ptr_)))
#endif
Home |
Main Index |
Thread Index |
Old Index