Disregard this post -- I forgot Drop was a special term ...
By rock, I guess you mean asteroid? Asteroids don't block line of fire in X-Wing.
Well, truth be told, it is a bit more complicated:
When measuring range during combat, if the edge of the range ruler between the closest points of the two ships overlaps an obstacle token, the attack is considered obstructed. Because of this obstruction, the defender rolls one additional defense die during the “Roll Defense Dice” step of this attack.
You can still fire but you do so less effectively (to a minimum of ineffectively).