@@ -540,35 +540,18 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
540
540
const size_t image_infos_size = image_infos.size ();
541
541
for (size_t i = 0 ; i < image_infos_size; i++) {
542
542
if (image_infos[i].header .filetype == llvm::MachO::MH_DYLINKER) {
543
- // In a "simulator" process (an x86 process that is
544
- // ios/tvos/watchos/bridgeos) we will have two dyld modules --
543
+ // In a "simulator" process we will have two dyld modules --
545
544
// a "dyld" that we want to keep track of, and a "dyld_sim" which
546
- // we don't need to keep track of here. If the target is an x86
547
- // system and the OS of the dyld binary is ios/tvos/watchos/bridgeos,
548
- // then we are looking at dyld_sym.
549
-
550
- // debugserver has only recently (late 2016) started sending up the os
551
- // type for each binary it sees -- so if we don't have an os type, use a
552
- // filename check as our next best guess.
553
- if (image_infos[i].os_type == llvm::Triple::OSType::UnknownOS) {
554
- if (image_infos[i].file_spec .GetFilename () != g_dyld_sim_filename) {
555
- dyld_idx = i;
556
- }
557
- } else if (target_arch.GetTriple ().getArch () == llvm::Triple::x86 ||
558
- target_arch.GetTriple ().getArch () == llvm::Triple::x86_64) {
559
- if (image_infos[i].os_type != llvm::Triple::OSType::IOS &&
560
- image_infos[i].os_type != llvm::Triple::TvOS &&
561
- image_infos[i].os_type != llvm::Triple::WatchOS) {
562
- // NEED_BRIDGEOS_TRIPLE image_infos[i].os_type != llvm::Triple::BridgeOS) {
563
- dyld_idx = i;
564
- }
545
+ // we don't need to keep track of here. dyld_sim will have a non-macosx
546
+ // OS.
547
+ if (target_arch.GetTriple ().getEnvironment () == llvm::Triple::Simulator &&
548
+ image_infos[i].os_type != llvm::Triple::OSType::MacOSX) {
549
+ continue ;
565
550
}
566
- else {
567
- // catch-all for any other environment -- trust that dyld is actually
568
- // dyld
569
- dyld_idx = i;
570
- }
571
- } else if (image_infos[i].header .filetype == llvm::MachO::MH_EXECUTE) {
551
+
552
+ dyld_idx = i;
553
+ }
554
+ if (image_infos[i].header .filetype == llvm::MachO::MH_EXECUTE) {
572
555
exe_idx = i;
573
556
}
574
557
}
0 commit comments