Is it possible to get both pdf bookmarks and hyperref for index links?

I loaded both the bookmark and hyperref package, but when I have them both the index links don't work. When I comment out the bookmark package the index links work, but the bookmarks don't. How do I fix this?

Minimal Not Working Example:

\documentclass{article}
\usepackage{lipsum}

\usepackage{bookmark} % Used for pdf bookmarks
\usepackage{imakeidx} % Used for index
\usepackage{hyperref} % Used for index links

\makeindex

\begin{document}
\section{foo}
\lipsum[1]
\index{foo}
\section{bar}
\index{bar}
\lipsum[2]

\printindex
\end{document}
• Load bookmark after imakeidx, also you don't have to load hyperref, bookmark will do it. If you want to load hyperref to pass an option do it before bookmark (but again after imakeidx). – Ulrike Fischer Jun 2 '16 at 6:30