This paper studies the linear stability problem for solitary wave solutions of Hamiltonian PDEs. The linear stability problem is formulated in terms of the Evans function, a complex analytic function denoted by $D(lambda)$, where $lambda$ is the stability exponent. The main result is the introduction of a new factor, denoted $Pi$, in the Pego-Weinstein derivative formula [ D(0) = Pi frac{dI}{dc},, ] where $I$ is the momentum of the solitary wave and $c$ is the speed. Moreover this factor turns out to be related to transversality of the solitary wave, modelled as a homoclinic orbit: the homoclinic orbit is transversely constructed if and only if $Pi eq 0$. The sign of $Pi$ is a symplectic invariant, an intrinsic property of the solitary wave, and is a key new factor affecting the linear stability. A supporting result is the introduction of a new abstract class of Hamiltonian PDEs built on a nonlinear Dirac-type equation, which model a wide range of Hamiltonian PDEs. Examples where the theory applies, other than Dirac operators, are the coupled mode equation in fluid mechanics and optics, the massive Thirring model, and coupled nonlinear wave equations. The new result is already present when the homoclinic orbit representation of the solitary wave lives in a four dimensional phase space, and so the theory is presented for this case, with the generalization to arbitrary dimension sketched.