Sorry to butt in, but I think what iefan means is that the formula is EΒ²=(mcΒ²)Β²+(pc)Β².
E=mcΒ² is only a special case of that: when an object is not moving relative to you and it has mass.
Light has no mass. And thatβs why the special case for that is E=pc.
So no, E=mcΒ² doesnβt always hol...