Relativistic Theory of the binding energies of heavy atomic ions