Fixes several issues to get small 64-bit apps to run on Mojave:
-
Fixes library discovery problems with the dyld shared cache. On Mojave, SYS_shared_region_check_np returns the whole lib region, while the existing code assumed its return value was the shared __LINKEDIT segment.
-
Demotes a DOCHECK at level 1 in check_thread_vm_area to 3 for Mac64 as it shows up as a large performance hit apparently due to slow memory queries.
-
Segment fixes: fixes two issues hit due to DR and lib segments being equal: a bb building assert for -no_mangle_app_seg and a dr_insert_get_seg_base() assert.
-
Attempts to reduce overhead in memquery_from_os() where it needs extra iterations to find the surrounding bounds of a free area, by walking backward instead of starting from 0.
-
Uses SYS_stat64 and SYS_fstat64 for stat syscalls.
-
Basic signal support:
- dynamorio_sigreturn() syscall number.
- master_signal_handler() setup to invoke sigreturn with the proper arguments.
- Accessing the frame within master_signal_handler_C().
- No support yet for AVX512 but put some pieces in place and comments for future work.
- fixup_rtframe_pointers() and copy_frame_to_stack().
- execute_handler_from_dispatch(): set up arguments for app handler, including the style.
- handle_sigreturn(): obtain signal number from siginfo.
Issue: #1979