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 [14] and a recent Korn-type inequality in GSBD p [20]. Our general strategy also allows to generalize integral representation results in SBD p , obtained in dimension two [28], to higher dimensions, and to revisit results in the framework of generalized special functions of bounded variation (GSBV p ).