Changeset 640b3df for libcfa/src/interpose.cfa
- Timestamp:
- Feb 21, 2023, 4:24:34 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 257a8f5, ce44c5f
- Parents:
- 1180175 (diff), 9a533ba (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
r1180175 r640b3df 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jan 5 22:23:57202313 // Update Count : 18 012 // 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 ); … … 62 53 63 54 static generic_fptr_t interpose_symbol( const char symbol[], const char version[] ) { 64 const char * error;65 66 55 static void * library; 67 56 static void * pthread_library; 57 68 58 if ( ! library ) { 69 #if defined( RTLD_NEXT ) 70 library = RTLD_NEXT; 71 #else 72 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 73 library = dlopen( "libc.so.6", RTLD_LAZY ); 74 error = dlerror(); 75 if ( error ) { 76 abort( "interpose_symbol : failed to open libc, %s\n", error ); 77 } 78 #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 79 64 } // if 80 65 if ( ! pthread_library ) { 81 #if defined( RTLD_NEXT ) 82 pthread_library = RTLD_NEXT; 83 #else 84 // missing RTLD_NEXT => must hard-code library name, assuming libstdc++ 85 pthread_library = dlopen( "libpthread.so", RTLD_LAZY ); 86 error = dlerror(); 87 if ( error ) { 88 abort( "interpose_symbol : failed to open libpthread, %s\n", error ); 89 } 90 #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 91 71 } // if 92 72
Note:
See TracChangeset
for help on using the changeset viewer.