Two of the petals are shaped differently - on the 24mm hood they're rounded but on the 24-105 hood they're cut off:
http://www.amazon.com/Canon-EW-83DII-Lens-Hood-24mm/dp/B00009R6V6
http://www.amazon.com/Canon-EW-83H-Lens-Hood-24-105mm/dp/B000B6A4S6
If the 24mm prime was f/4 then it could probably use the 24-105's hood... but it's not, it's f/1.4 and would vignette horribly wide open.
Bob
But as Richard pointed out, the hoods are nearly identical.
^^^ Simply this. The hood for the zoom has the front squared off so you can stand the lens upright on it. Otherwise no difference.
![]()
The reason that the petals are different is that the sensor is rectangular, If it were square then all four petals should be the same. Simple fact - any hood on a zoom is a compromise. If it is small enough to provide full protection against flair at the longest setting, then it will vignette at the widest setting.