They have been associated with a very small increased risk of cancer, particularly leukemia, for an unborn baby. But the risk is very small.
x-rays are generally safe in pregnancy. If your doctor finds you need x-rays for a medical problem or injury, it's OK to have them. It's better for your baby that you be healthy.