The chip shortage is damaging shares of companies that build devices and boosting the ones supplying the parts.