bool Binary::unexport(const Symbol& sym) {
  if (DyldInfo* dyld = dyld_info()) {
    const auto it_export = std::find_if(
        std::begin(dyld->export_info_), std::end(dyld->export_info_),
        [&sym] (const std::unique_ptr<ExportInfo>& info) {
          return info->has_symbol() && *info->symbol() == sym;
        });

    // The symbol is not exported
    if (it_export == std::end(dyld->export_info_)) {
      return false;
    }

    dyld->export_info_.erase(it_export);
    return true;
  }


  if (DyldExportsTrie* exports = dyld_exports_trie()) {
    const auto it_export = std::find_if(
        std::begin(exports->export_info_), std::end(exports->export_info_),
        [&sym] (const std::unique_ptr<ExportInfo>& info) {
          return info->has_symbol() && *info->symbol() == sym;
        });

    // The symbol is not exported
    if (it_export == std::end(exports->export_info_)) {
      return false;
    }

    exports->export_info_.erase(it_export);
    return true;
  }

  LIEF_INFO("Can't find neither LC_DYLD_INFO / LC_DYLD_CHAINED_FIXUPS");
  return false;
}
bool Binary::unexport(const Symbol& sym) {
  if (DyldInfo* dyld = dyld_info()) {
    const auto it_export = std::find_if(
        std::begin(dyld->export_info_), std::end(dyld->export_info_),
        [&sym] (const std::unique_ptr<ExportInfo>& info) {
          return info->has_symbol() && *info->symbol() == sym;
        });

     
    if (it_export == std::end(dyld->export_info_)) {
      return false;
    }

    dyld->export_info_.erase(it_export);
    return true;
  }


  if (DyldExportsTrie* exports = dyld_exports_trie()) {
    const auto it_export = std::find_if(
        std::begin(exports->export_info_), std::end(exports->export_info_),
        [&sym] (const std::unique_ptr<ExportInfo>& info) {
          return info->has_symbol() && *info->symbol() == sym;
        });

     
    if (it_export == std::end(exports->export_info_)) {
      return false;
    }

    exports->export_info_.erase(it_export);
    return true;
  }

  LIEF_INFO("Can't find neither LC_DYLD_INFO / LC_DYLD_CHAINED_FIXUPS");
  return false;
}