Changeset c910709 for libcfa/src
- Timestamp:
- Feb 19, 2023, 5:41:53 PM (18 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 0bcd707, f883ef1
- Parents:
- 3494ca9
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
r3494ca9 rc910709 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 9 08:44:03202313 // Update Count : 18 212 // Last Modified On : Sun Feb 19 17:09:16 2023 13 // Update Count : 183 14 14 // 15 15 … … 45 45 union { generic_fptr_t fptr; void * ptr; } originalFunc; 46 46 47 #if defined( _GNU_SOURCE ) 48 if ( version ) { 49 originalFunc.ptr = dlvsym( library, symbol, version ); 50 } else { 51 originalFunc.ptr = dlsym( library, symbol ); 52 } 53 #else 54 originalFunc.ptr = dlsym( library, symbol ); 55 #endif // _GNU_SOURCE 56 47 originalFunc.ptr = dlsym( library, symbol ); 57 48 error = dlerror(); 58 49 if ( error ) abort( "interpose_symbol : internal error, %s\n", error ); … … 66 57 67 58 if ( ! library ) { 68 #if defined( RTLD_NEXT ) 69 library = RTLD_NEXT; 70 #else 71 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 72 library = dlopen( "libc.so.6", RTLD_LAZY ); 73 const char * error = dlerror(); 74 if ( error ) { 75 abort( "interpose_symbol : failed to open libc, %s\n", error ); 76 } 77 #endif 59 library = dlopen( "libc.so.6", RTLD_LAZY ); 60 const char * error = dlerror(); 61 if ( error ) { 62 abort( "interpose_symbol : failed to open libc, %s\n", error ); 63 } // if 78 64 } // if 79 65 if ( ! pthread_library ) { 80 #if defined( RTLD_NEXT ) 81 pthread_library = RTLD_NEXT; 82 #else 83 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 84 pthread_library = dlopen( "libpthread.so", RTLD_LAZY ); 85 const char * error = dlerror(); 86 if ( error ) { 87 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 88 } 89 #endif 66 pthread_library = dlopen( "libpthread.so", RTLD_LAZY ); 67 const char * error = dlerror(); 68 if ( error ) { 69 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 70 } // if 90 71 } // if 91 72 -
libcfa/src/interpose_thread.cfa
r3494ca9 rc910709 41 41 static void * library; 42 42 if ( ! library ) { 43 #if defined( RTLD_NEXT ) 44 library = RTLD_NEXT; 45 #else 46 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 47 library = dlopen( "libpthread.so", RTLD_LAZY ); 48 const char * error = dlerror(); 49 if ( error ) { 50 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 51 } 52 #endif 43 library = dlopen( "libpthread.so", RTLD_LAZY ); 44 const char * error = dlerror(); 45 if ( error ) { 46 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 47 } 53 48 } // if 54 49
Note: See TracChangeset
for help on using the changeset viewer.