Core-electron binding-energy shifts at surfaces