Changeset e10714a


Ignore:
Timestamp:
Mar 27, 2023, 9:58:08 PM (15 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
60380a1
Parents:
4eebbcc
Message:

update interpose code, and document 32-bit interpose bug in glibc

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    r4eebbcc re10714a  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar 13 22:39:12 2023
    13 // Update Count     : 193
     12// Last Modified On : Mon Mar 27 21:09:03 2023
     13// Update Count     : 196
    1414//
    1515
     
    4040        union { generic_fptr_t fptr; void * ptr; } originalFunc;
    4141
     42        #if defined( _GNU_SOURCE )
     43        if ( version ) {
     44                originalFunc.ptr = dlvsym( library, symbol, version );
     45        } else {
     46                originalFunc.ptr = dlsym( library, symbol );
     47        } // if
     48        #else
    4249        originalFunc.ptr = dlsym( library, symbol );
    43         if ( ! originalFunc.ptr ) {                                                             // == nullptr
     50        #endif // _GNU_SOURCE
     51
     52        if ( ! originalFunc.ptr ) {                                                     // == nullptr
    4453                abort( "interpose_symbol : internal error, %s\n", dlerror() );
    4554        } // if
     
    4958static generic_fptr_t interpose_symbol( const char symbol[], const char version[] ) {
    5059        void * library;
     60
    5161        #if defined( RTLD_NEXT )
    5262        library = RTLD_NEXT;
  • libcfa/src/interpose_thread.cfa

    r4eebbcc re10714a  
    1414//
    1515
     16// BUG in 32-bit gcc with interpose: fixed in >= gcc-9.5, gcc-10.4, gcc-12.2
    1617#ifdef __i386__                                                                                 // 32-bit architecture
    1718#undef _GNU_SOURCE
     
    3334typedef void (* generic_fptr_t)(void);
    3435
    35 generic_fptr_t interpose_symbol(
     36generic_fptr_t libcfa_public interpose_symbol(
    3637        generic_fptr_t (*do_interpose_symbol)( void * library, const char symbol[], const char version[] ),
    3738        const char symbol[],
    3839        const char version[]
    39 ) libcfa_public {
     40) {
    4041        void * library;
    4142
Note: See TracChangeset for help on using the changeset viewer.