Taking free relief from an immovable obstruction is permitted if the ball lies in or on the obstruction, or close enough that it interferes with the stance or swing.
The nearest point of relief is determined and the player drops without penalty within one club length of that point. If the ball is in a bunker, it must be dropped in the bunker (unless you are willing to take a penalty). If it's on the putting green, the ball can be placed at the nearest point of relief no nearer the hole, with the nearest point possibly being off the putting surface.

