  In this paper we prove an integral representation formula for a general class
of energies defined on the space of generalized special functions of bounded
deformation ($GSBD^p$) in arbitrary space dimensions. Functionals of this type
naturally arise in the modeling of linear elastic solids with surface
discontinuities including phenomena as fracture, damage, surface tension
between different elastic phases, or material voids. Our approach is based on
the global method for relaxation devised in Bouchitt\`e et al. '98 and a recent
Korn-type inequality in $GSBD^p$ (Cagnetti-Chambolle-Scardia '20). Our general
strategy also allows to generalize integral representation results in $SBD^p$,
obtained in dimension two (Conti-Focardi-Iurlano '16), to higher dimensions,
and to revisit results in the framework of generalized special functions of
bounded variation ($GSBV^p$).
