Explaining the mechanism of superconductivity in the high-Tc cuprates requires an understanding of what causes electrons to form Cooper pairs. Pairing can be mediated by phonons, the screened Coulomb force, spin or charge fluctuations, excitons, or by a combination of these. An excitonic pairing mechanism has been postulated, but experimental evidence for coupling between conduction electrons and excitons in the cuprates is sporadic. Here we use resonant inelastic x-ray scattering to monitor the temperature dependence of the d _ d exciton spectrum of Bi2 Sr2 CaCu2 O8 -x crystals with different charge carrier concentrations. We observe a significant change of the d _d exciton spectra when the materials pass from the normal state into the superconductor state. Our observations show that the d _d excitons start to shift up (down) in the overdoped (underdoped) sample when the material enters the superconducting phase. We attribute the superconductivity-induced effect and its sign reversal from underdoped to overdoped to the exchange coupling of the site of the d _d exciton to the surrounding copper spins.