@@ -707,11 +707,10 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
707707 ) ;
708708 }
709709 "android" => {
710- // "signal"
710+ // "signal" -- just needs a non-zero pointer value (function does not even get called),
711+ // but we arrange for this to be callable anyway (it will then do nothing).
711712 let layout = this. machine . layouts . const_raw_ptr ;
712- let dlsym = Dlsym :: from_str ( "signal" . as_bytes ( ) , & this. tcx . sess . target . os ) ?
713- . expect ( "`signal` must be an actual dlsym on android" ) ;
714- let ptr = this. fn_ptr ( FnVal :: Other ( dlsym) ) ;
713+ let ptr = this. fn_ptr ( FnVal :: Other ( DynSym :: from_str ( "signal" ) ) ) ;
715714 let val = ImmTy :: from_scalar ( Scalar :: from_pointer ( ptr, this) , layout) ;
716715 Self :: alloc_extern_static ( this, "signal" , val) ?;
717716 // A couple zero-initialized pointer-sized extern statics.
@@ -867,7 +866,7 @@ impl<'mir, 'tcx> MiriInterpCxExt<'mir, 'tcx> for MiriInterpCx<'mir, 'tcx> {
867866/// Machine hook implementations.
868867impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for MiriMachine < ' mir , ' tcx > {
869868 type MemoryKind = MiriMemoryKind ;
870- type ExtraFnVal = Dlsym ;
869+ type ExtraFnVal = DynSym ;
871870
872871 type FrameExtra = FrameExtra < ' tcx > ;
873872 type AllocExtra = AllocExtra < ' tcx > ;
@@ -939,15 +938,15 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
939938 #[ inline( always) ]
940939 fn call_extra_fn (
941940 ecx : & mut MiriInterpCx < ' mir , ' tcx > ,
942- fn_val : Dlsym ,
941+ fn_val : DynSym ,
943942 abi : Abi ,
944943 args : & [ FnArg < ' tcx , Provenance > ] ,
945944 dest : & PlaceTy < ' tcx , Provenance > ,
946945 ret : Option < mir:: BasicBlock > ,
947- _unwind : mir:: UnwindAction ,
946+ unwind : mir:: UnwindAction ,
948947 ) -> InterpResult < ' tcx > {
949948 let args = ecx. copy_fn_args ( args) ?; // FIXME: Should `InPlace` arguments be reset to uninit?
950- ecx. call_dlsym ( fn_val, abi, & args, dest, ret)
949+ ecx. emulate_dyn_sym ( fn_val, abi, & args, dest, ret, unwind )
951950 }
952951
953952 #[ inline( always) ]
0 commit comments