Dislocation pileups and elastic cracks at a bimaterial interface