]> git.lizzy.rs Git - rust.git/blob - src/shims/posix/linux/dlsym.rs
Replace target.target with target
[rust.git] / src / shims / posix / linux / dlsym.rs
1 use rustc_middle::mir;
2
3 use crate::*;
4
5 #[derive(Debug, Copy, Clone)]
6 pub enum Dlsym {
7 }
8
9 impl Dlsym {
10     // Returns an error for unsupported symbols, and None if this symbol
11     // should become a NULL pointer (pretend it does not exist).
12     pub fn from_str(name: &str) -> InterpResult<'static, Option<Dlsym>> {
13         Ok(match &*name {
14             "__pthread_get_minstack" => None,
15             _ => throw_unsup_format!("unsupported Linux dlsym: {}", name),
16         })
17     }
18 }
19
20 impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
21 pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
22     fn call_dlsym(
23         &mut self,
24         dlsym: Dlsym,
25         _args: &[OpTy<'tcx, Tag>],
26         ret: Option<(PlaceTy<'tcx, Tag>, mir::BasicBlock)>,
27     ) -> InterpResult<'tcx> {
28         let this = self.eval_context_mut();
29         let (_dest, _ret) = ret.expect("we don't support any diverging dlsym");
30         assert!(this.tcx.sess.target.target_os == "linux");
31
32         match dlsym {}
33     }
34 }