]> Zhao Yanbai Git Server - minix.git/commitdiff
various symbol referencing fixes
authorBen Gras <ben@minix3.org>
Thu, 28 Jun 2012 12:56:50 +0000 (14:56 +0200)
committerBen Gras <ben@minix3.org>
Thu, 28 Jun 2012 13:20:53 +0000 (15:20 +0200)
make weak symbol references and namespace renames references
the renamed versions.

function renaming, weak symbol references and libc namespace.h
protection interact in hairy ways and causes weak symbol references
for renamed functions to be unresolved; e.g. vfork should be an
alias for _vfork but _vfork doesn't exist because __vfork14()
exists.

this is a problem for dynamically linked executables as all symbols
have to be resolved, used or not, at link time. it was masked by
clang-compiled base system libraries but is a problem when gcc does
it.

lib/libc/include/namespace.h
lib/libc/sys-minix/sem.c
lib/libc/sys-minix/vfork.c
lib/libc/time/localtime.c
lib/librefuse/Makefile

index 6e47c11b024a2d07d67e9c23c51e210bf089429f..077b2a89d8285943e862f07dd7ceb28b81ee9410 100644 (file)
 #define confstr                        _confstr
 #define csetexpandtc           _csetexpandtc
 #define ctermid                        _ctermid
-#define ctime_r                        _ctime_r
-#define ctime_rz               _ctime_rz
+#define ctime_r                        __ctime_r50
+#define ctime_rz               __ctime_rz50
 #define daemon                 _daemon
 #define dbopen                 _dbopen
 #define devname                        _devname
 #define lcong48                        _lcong48
 #define llabs                  _llabs
 #define lldiv                  _lldiv
-#define localtime_r            _localtime_r
-#define localtime_rz           _localtime_rz
+#define localtime_r            __localtime_r50
+#define localtime_rz           __localtime_rz50
 #define lockf                  _lockf
 #define lrand48                        _lrand48
 #define lseek                  _lseek
 #define mergesort              _mergesort
 #define mi_vector_hash         _mi_vector_hash
 #define mkstemp                        _mkstemp
-#define mktime_z               _mktime_z
+#define mktime_z               __mktime_z50
 #define mpool_close            _mpool_close
 #define mpool_filter           _mpool_filter
 #define mpool_get              _mpool_get
 #define pmap_unset             _pmap_unset
 #define pollts                 _pollts
 #define popen                  _popen
-#define posix2time             _posix2time
-#define posix2time_z           _posix2time_z
+#define posix2time             __posix2time50
+#define posix2time_z           __posix2time_z50
 #define pread                  _pread
 #define pselect                        _pselect
 #define psignal                        _psignal
 #define minix_mmap _minix_mmap
 #define minix_munmap _minix_munmap
 #define minix_munmap_text _minix_munmap_text
-#define vfork _vfork
+#define vfork __vfork14
 #endif /* __minix */
 
 #endif /* __weak_alias */
index 0deab40d24147df1c1f8e1d0c777079021ab6829..afb9bb828022cf20b1d4ed969ca7fa15b5f2fc3c 100644 (file)
 #include <stdarg.h>
 #include <errno.h>
 
-#ifdef __weak_alias
-__weak_alias(sem, _sem)
-#endif
-
 static int get_ipc_endpt(endpoint_t *pt)
 {
        return minix_rs_lookup("ipc", pt);
index c4e8e4de5d162590b9a70df69ca95097ef3541c1..bd489864a58a33d967f729d4561f5ca1b7381a25 100644 (file)
@@ -5,7 +5,7 @@
 #include <unistd.h>
 
 #ifdef __weak_alias
-__weak_alias(vfork, _vfork)
+__weak_alias(vfork, __vfork14)
 #endif
 
 pid_t vfork()
index 194fd9cd5d53d289c8d45d244c23c2bf1924623a..f1be999a7e0e123008978ff8bb8ebb0893c9dd99 100644 (file)
@@ -28,14 +28,14 @@ __RCSID("$NetBSD: localtime.c,v 1.54 2011/01/15 15:42:10 christos Exp $");
 #include "reentrant.h"
 
 #if defined(__weak_alias)
-__weak_alias(ctime_r,_ctime_r)
-__weak_alias(ctime_rz,_ctime_rz)
+__weak_alias(ctime_r,__ctime_r50)
+__weak_alias(ctime_rz,__ctime_rz50)
 __weak_alias(daylight,_daylight)
-__weak_alias(mktime_z,_mktime_z)
-__weak_alias(localtime_r,_localtime_r)
-__weak_alias(localtime_rz,_localtime_rz)
-__weak_alias(posix2time,_posix2time)
-__weak_alias(posix2time_z,_posix2time_z)
+__weak_alias(mktime_z,__mktime_z50)
+__weak_alias(localtime_r,__localtime_r50)
+__weak_alias(localtime_rz,__localtime_rz50)
+__weak_alias(posix2time,__posix2time50)
+__weak_alias(posix2time_z,__posix2time_z50)
 __weak_alias(tzname,_tzname)
 #endif
 
index d01b198bbedbb9c42402adec534eba11d257551d..de640d25987c5efc1afd8fd344ce37a2ae40461d 100644 (file)
@@ -1,6 +1,6 @@
 # $NetBSD: Makefile,v 1.8 2007/11/05 13:41:52 pooka Exp $
 
-USE_FORT?=     yes     # data driven bugs?
+USE_FORT?=     no      # data driven bugs?
 
 LIB=           refuse
 LIBDPLIBS+=    puffs   ${.CURDIR}/../libpuffs