Ideally, one would just use an \apptocmd command (from etoolbox package) or \xapptocmd (from xpatch package) in order to hook the appropiate hypertarget/hyperlink command, but unfortunately, this breaks due to the definition of the structuring commands (such as \part, \chapter etc.)
A generic 'slight' redefinition of those commands provides this, however. At first, a generic structuring command is used, at the begin of a document, a loop of the (seven) commands defines those commands and adds the link. Otherwise, those commands behave as their original definitions (therefore, \LaTeXStandardpart etc. has to be defined, via a loop and using \csletcs command).
\documentclass{book}
\usepackage{etoolbox}%
\usepackage[final,pdftex]{hyperref}%
\listgadd{\StructureCommandsList}{}%
\newcommand{\LetLaTeXStandardSectionCommand}[1]{%
\csletcs{LaTeXStandard#1}{#1}%
}%
\makeatletter%
\apptocmd{\tableofcontents}{\phantomsection\hypertarget{document::toc}{}}{}{}%
\newcommand{\redefinestructurecommands}[1]{%
\csgdef{unstarred#1@@noopt}##1{%
\csuse{unstarred#1@@opt}[##1]{##1}%
}%
\csgdef{unstarred#1@@opt}[##1]##2{%
\csuse{LaTeXStandard#1}[##1]{\hyperlink{document::toc}{##2}}%
}%
\csgdef{unstarred#1}{%
\@ifnextchar[{%
\@nameuse{unstarred#1@@opt}%
}{%
\@nameuse{unstarred#1@@noopt}%
}%
}%
\csgdef{starred#1@@noopt}##1{%
\csuse{LaTeXStandard#1}*{\hyperlink{document::toc}{##1}}%
}%
\csgdef{unstarred#1}{%
\@ifnextchar[{%
\csuse{unstarred#1@@opt}%
}{%
\csuse{unstarred#1@@noopt}%
}%
}%
\csgdef{#1}{%
\@ifstar{%
\csuse{starred#1@@noopt}%
}{%
\csuse{unstarred#1}%
}%
}%
}%
\makeatother
\newcommand{\RedefineStructuringCommands}{%
% If some of the structuring commands should not use linking back to toc, just remove them from this csv - list here (say for subparagraph))
\forcsvlist{\listgadd{\StructureCommandsList}}{part,chapter,section,subsection,subsubsection,paragraph,subparagraph}%
\forlistloop{\LetLaTeXStandardSectionCommand}{\StructureCommandsList}%
\forlistloop{\redefinestructurecommands}{\StructureCommandsList}%
}%
\AtBeginDocument{%
\RedefineStructuringCommands%
}%
\setcounter{secnumdepth}{5}% For demo only
\setcounter{tocdepth}{5}% For demo only
\begin{document}
\chapter*{Introduction}%
\tableofcontents%
\part{First part}%
\chapter{First chapter}%
\section{First Section}%
\section*{First starred section}%
\subsection{First subsection}%
\subsubsection{First subsubsection}%
\paragraph{First paragraph}
\subparagraph{First subparagraph}%
\end{document}
I omitted a screenshot, as it does not reveal really anything.
Note: The above redefinition command \redefinestructurecommand is part of an yet to be published package, it's usually longer and more sophisticated ;-)
hyperrefshould be loaded last (there are some exceptions). Think about how you are going to deal with that. This is a very important thing and if you don't take care of any possible solution, something is about to break. – Johannes_B Sep 03 '14 at 08:00