delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2005/01/07/13:27:58

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
From: <ams AT ludd DOT ltu DOT se>
Message-Id: <200501071827.j07IRfOx010705@speedy.ludd.ltu.se>
Subject: dlsymresolver (was: More complaints from tests/libclink/check)
In-Reply-To: <200412311242.iBVCgqLY006397@speedy.ludd.ltu.se>
"from ams AT ludd DOT ltu DOT se at Dec 31, 2004 01:42:52 pm"
To: djgpp-workers AT delorie DOT com
Date: Fri, 7 Jan 2005 19:27:41 +0100 (CET)
X-Mailer: ELM [version 2.4ME+ PL78 (25)]
MIME-Version: 1.0
X-ltu-MailScanner-Information: Please contact the ISP for more information
X-ltu-MailScanner: Found to be clean
X-MailScanner-From: ams AT ludd DOT ltu DOT se
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

According to ams AT ludd DOT ltu DOT se:
> dlopen.o: (P),(O)
> dlopen.o: (P) != stub (_dl_nmaxsymtab)
>   T _dl_nmaxsymtab
>   T _dl_nsymtab
>   T _dl_symtabs
>   T _dl_unresolved_count
>   T _dl_unresolved_symbol
>   T dlclose
>   T dlopen
>   T dlsym
>   T dlsymresolver
>   U _chmod
>   U _close
>   U _open
>   U _read
>   U _truename
>   U errno
>   U free
>   U getenv
>   U malloc
>   U memcpy
>   U memset
>   U strchr
>   U strcmp
>   U strcpy
>   U strspn

dlsymresolver isn't POSIX. Patch follows.


Right,

						MartinS

Index: djgpp/include/sys/dxe.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/sys/dxe.h,v
retrieving revision 1.4
diff -p -u -r1.4 dxe.h
--- djgpp/include/sys/dxe.h	23 Apr 2003 18:54:31 -0000	1.4
+++ djgpp/include/sys/dxe.h	7 Jan 2005 18:15:47 -0000
@@ -137,7 +137,7 @@ int dlunregsym (const dxe_symbol_table *
  * that the dynamic loader have at his disposition. The handler should return
  * NULL to rise a error condition, otherwise it should return a valid address.
  */
-extern void *(*dlsymresolver) (const char *symname);
+extern void *(*_dlsymresolver) (const char *symname);
 
 /* The following variable contains a pointer to a function that is being
  * called when static linking fails because of missing module. Note that
Index: djgpp/src/libc/dxe/dlopen.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dxe/dlopen.c,v
retrieving revision 1.2
diff -p -u -r1.2 dlopen.c
--- djgpp/src/libc/dxe/dlopen.c	29 Apr 2003 03:51:28 -0000	1.2
+++ djgpp/src/libc/dxe/dlopen.c	7 Jan 2005 18:15:55 -0000
@@ -73,7 +73,7 @@ typedef struct __dxe_handle
 } dxe_handle, *dxe_h;
 
 /* Last-resort symbol resolver */
-void *(*dlsymresolver) (const char *symname) = NULL;
+void *(*_dlsymresolver) (const char *symname) = NULL;
 /* Last-error unresolved symbol count */
 int _dl_unresolved_count = 0;
 /* Last-error unresolved symbol */
@@ -382,8 +382,8 @@ void *dlsym (void *dxe, const char *symn
           }
 modscan_done:
 
-    if (!sym && dlsymresolver)
-      sym = dlsymresolver (symname);
+    if (!sym && _dlsymresolver)
+      sym = _dlsymresolver (symname);
 
     return sym;
   }
Index: djgpp/src/libc/dxe/dlregsym.txh
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dxe/dlregsym.txh,v
retrieving revision 1.1
diff -p -u -r1.1 dlregsym.txh
--- djgpp/src/libc/dxe/dlregsym.txh	23 Apr 2003 06:10:56 -0000	1.1
+++ djgpp/src/libc/dxe/dlregsym.txh	7 Jan 2005 18:15:55 -0000
@@ -53,14 +53,14 @@ Returns number of symbol tables in use i
 
 @portability !ansi, !posix
 
-@node dlsymresolver, misc
-@findex dlsymresolver
+@node _dlsymresolver, misc
+@findex _dlsymresolver
 @subheading Syntax
 
 @example
 #include <sys/dxe.h>
 
-extern void *(*dlsymresolver) (const char *symname);
+extern void *(*_dlsymresolver) (const char *symname);
 @end example
 
 @subheading Description
Index: djgpp/tests/dxe/dldemo.cpp
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/dxe/dldemo.cpp,v
retrieving revision 1.1
diff -p -u -r1.1 dldemo.cpp
--- djgpp/tests/dxe/dldemo.cpp	23 Apr 2003 06:39:15 -0000	1.1
+++ djgpp/tests/dxe/dldemo.cpp	7 Jan 2005 18:15:58 -0000
@@ -49,7 +49,7 @@ void *dxe_res (const char *symname)
 int main ()
 {
   // Set the error callback function
-  dlsymresolver = dxe_res;
+  _dlsymresolver = dxe_res;
 
   // Register the symbols exported into dynamic modules
   dlregsym (syms);

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019