Binding energy and equilibrium of compact objects