  This paper presents a systematic study of the relative entropy technique for
compressible motions of continuum bodies described as Hamiltonian flows. While
the description for the classical mechanics of $N$ particles involves a
Hamiltonian in terms of position and momentum vectors, that for the continuum
fluid involves a Hamiltonian in terms of density and momentum. For space
dimension $d\ge 2$, the Hamiltonian functional has a non-convex dependency on
the deformation gradient or placement map due to material frame indifference.
Because of this, the applicability of the relative entropy technique with
respect to the deformation gradient or the placement map is inherently limited.
Despite these limitations, we delineate the feasible applications and
limitations of the technique by pushing it to its available extent.
Specifically, we derive the relative Hamiltonian identity, where the
Hamiltonian takes the position and momentum field as its primary and conjugate
state variables, all within the context of the referential coordinate system
that describes the motion.
  This approach, when applicable, turns out to yield rather strong stability
statements. As instances, we consider Euler-Poisson systems in one space
dimension. For a specific pressureless model, we verify non-increasing $L^2$
state differences before the formation of $\delta$-shock. In addition,
weak-strong uniqueness, stability of rarefaction waves, and convergence to the
gradient flow in the singular limit of large friction are shown. Depending on
the presence or absence of pressure, assumptions are made to suitably
accommodate phenomena such as $\delta$-shocks, vacuums, and shock
discontinuities in the weak solutions.
