@@ -124,7 +124,7 @@ static void sh_switch_dump_enter(sh_switch_t *self) {
124124}
125125
126126static int sh_switch_hook_unique (uintptr_t target_addr , uintptr_t new_addr , uintptr_t * orig_addr ,
127- size_t * backup_len , xdl_info_t * dlinfo ) {
127+ size_t * backup_len , xdl_info_t * dlinfo , bool ignore_symbol_check ) {
128128 sh_switch_t * self = sh_switch_find (target_addr );
129129 if (NULL != self ) return SHADOWHOOK_ERRNO_HOOK_DUP ;
130130
@@ -148,7 +148,8 @@ static int sh_switch_hook_unique(uintptr_t target_addr, uintptr_t new_addr, uint
148148 (NULL != safe_orig_addr_addr && 0 == __atomic_load_n (safe_orig_addr_addr , __ATOMIC_ACQUIRE ))
149149 ? safe_orig_addr_addr
150150 : NULL ;
151- if (0 != (r = sh_inst_hook (& self -> inst , target_addr , dlinfo , new_addr , orig_addr , orig_addr2 ))) {
151+ if (0 != (r = sh_inst_hook (& self -> inst , target_addr , dlinfo , new_addr , orig_addr , orig_addr2 ,
152+ ignore_symbol_check ))) {
152153 RB_REMOVE (sh_switch_tree , & sh_switches , self );
153154 useless = self ;
154155 goto end ;
@@ -163,7 +164,7 @@ static int sh_switch_hook_unique(uintptr_t target_addr, uintptr_t new_addr, uint
163164}
164165
165166static int sh_switch_hook_shared (uintptr_t target_addr , uintptr_t new_addr , uintptr_t * orig_addr ,
166- size_t * backup_len , xdl_info_t * dlinfo ) {
167+ size_t * backup_len , xdl_info_t * dlinfo , bool ignore_symbol_check ) {
167168 int r ;
168169
169170 pthread_rwlock_rdlock (& sh_switches_lock ); // SYNC(read) - start
@@ -201,8 +202,9 @@ static int sh_switch_hook_shared(uintptr_t target_addr, uintptr_t new_addr, uint
201202 } else {
202203 // do hook
203204 uintptr_t * safe_orig_addr_addr = sh_safe_get_orig_addr_addr (target_addr );
204- if (0 != (r = sh_inst_hook (& self -> inst , target_addr , dlinfo , hub_trampo ,
205- sh_hub_get_orig_addr_addr (self -> hub ), safe_orig_addr_addr ))) {
205+ if (0 !=
206+ (r = sh_inst_hook (& self -> inst , target_addr , dlinfo , hub_trampo , sh_hub_get_orig_addr_addr (self -> hub ),
207+ safe_orig_addr_addr , ignore_symbol_check ))) {
206208 RB_REMOVE (sh_switch_tree , & sh_switches , self );
207209 useless = self ;
208210 goto end ;
@@ -231,12 +233,12 @@ static int sh_switch_hook_shared(uintptr_t target_addr, uintptr_t new_addr, uint
231233}
232234
233235int sh_switch_hook (uintptr_t target_addr , uintptr_t new_addr , uintptr_t * orig_addr , size_t * backup_len ,
234- xdl_info_t * dlinfo ) {
236+ xdl_info_t * dlinfo , bool ignore_symbol_check ) {
235237 int r ;
236238 if (SHADOWHOOK_IS_UNIQUE_MODE )
237- r = sh_switch_hook_unique (target_addr , new_addr , orig_addr , backup_len , dlinfo );
239+ r = sh_switch_hook_unique (target_addr , new_addr , orig_addr , backup_len , dlinfo , ignore_symbol_check );
238240 else
239- r = sh_switch_hook_shared (target_addr , new_addr , orig_addr , backup_len , dlinfo );
241+ r = sh_switch_hook_shared (target_addr , new_addr , orig_addr , backup_len , dlinfo , ignore_symbol_check );
240242
241243 if (0 == r )
242244 SH_LOG_INFO ("switch: hook in %s mode OK: target_addr %" PRIxPTR ", new_addr %" PRIxPTR ,
@@ -251,7 +253,7 @@ static int sh_switch_hook_unique_invisible(uintptr_t target_addr, uintptr_t new_
251253
252254 // do hook
253255 sh_inst_t inst ;
254- int r = sh_inst_hook (& inst , target_addr , dlinfo , new_addr , orig_addr , NULL );
256+ int r = sh_inst_hook (& inst , target_addr , dlinfo , new_addr , orig_addr , NULL , false );
255257
256258 pthread_rwlock_unlock (& sh_switches_lock ); // SYNC - end
257259
@@ -260,12 +262,14 @@ static int sh_switch_hook_unique_invisible(uintptr_t target_addr, uintptr_t new_
260262}
261263
262264int sh_switch_hook_invisible (uintptr_t target_addr , uintptr_t new_addr , uintptr_t * orig_addr ,
263- size_t * backup_len , xdl_info_t * dlinfo ) {
265+ size_t * backup_len , xdl_info_t * dlinfo , bool ignore_symbol_check ) {
266+ (void )ignore_symbol_check ;
267+
264268 int r ;
265269 if (SHADOWHOOK_IS_UNIQUE_MODE )
266270 r = sh_switch_hook_unique_invisible (target_addr , new_addr , orig_addr , backup_len , dlinfo );
267271 else
268- r = sh_switch_hook_shared (target_addr , new_addr , orig_addr , backup_len , dlinfo );
272+ r = sh_switch_hook_shared (target_addr , new_addr , orig_addr , backup_len , dlinfo , false );
269273
270274 if (0 == r )
271275 SH_LOG_INFO ("switch: hook(invisible) in %s mode OK: target_addr %" PRIxPTR ", new_addr %" PRIxPTR ,
0 commit comments