Module Name:    src
Committed By:   kamil
Date:           Fri Jan  5 19:29:44 UTC 2018

Modified Files:
        src/lib/libc/dlfcn: dlfcn_elf.c
        src/lib/libc/include: namespace.h

Log Message:
Register dl_iterate_phdr in the libc's namespace.h

The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

Stop using the public global name of dl_iterate_phdr in tls/tls.c:
__libc_static_tls_setup().

Follow the approach with other dlopen(3)-like functions with the
namespace.h in the dl_iterate_phdr() case. Use internally a weak symbol:
__dl_iterate_phdr instead of dl_iterate_phdr.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/dlfcn/dlfcn_elf.c
cvs rdiff -u -r1.190 -r1.191 src/lib/libc/include/namespace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/dlfcn/dlfcn_elf.c
diff -u src/lib/libc/dlfcn/dlfcn_elf.c:1.14 src/lib/libc/dlfcn/dlfcn_elf.c:1.15
--- src/lib/libc/dlfcn/dlfcn_elf.c:1.14	Tue Jul 11 15:21:35 2017
+++ src/lib/libc/dlfcn/dlfcn_elf.c	Fri Jan  5 19:29:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dlfcn_elf.c,v 1.14 2017/07/11 15:21:35 joerg Exp $	*/
+/*	$NetBSD: dlfcn_elf.c,v 1.15 2018/01/05 19:29:44 kamil Exp $	*/
 
 /*
  * Copyright (c) 2000 Takuya SHIOZAKI
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: dlfcn_elf.c,v 1.14 2017/07/11 15:21:35 joerg Exp $");
+__RCSID("$NetBSD: dlfcn_elf.c,v 1.15 2018/01/05 19:29:44 kamil Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -38,6 +38,7 @@ __RCSID("$NetBSD: dlfcn_elf.c,v 1.14 201
 #include <string.h>
 #include <stdbool.h>
 
+#undef dl_iterate_phdr
 #undef dlopen
 #undef dlclose
 #undef dlsym

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.190 src/lib/libc/include/namespace.h:1.191
--- src/lib/libc/include/namespace.h:1.190	Fri Jan  5 18:57:06 2018
+++ src/lib/libc/include/namespace.h	Fri Jan  5 19:29:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.190 2018/01/05 18:57:06 kamil Exp $	*/
+/*	$NetBSD: namespace.h,v 1.191 2018/01/05 19:29:44 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -926,6 +926,7 @@
 #define yperr_string		_yperr_string
 #define ypprot_err		_ypprot_err
 #define yp_setbindtries		_yp_setbindtries
+#define dl_iterate_phdr		__dl_iterate_phdr
 #define dlopen			__dlopen
 #define dlclose			__dlclose
 #define dlsym			__dlsym

Reply via email to