Sean Connery and John Lennon both got married there, and Ian Fleming was inspired by a real-life WW2 incident to use it in his novel Thunderball.
The opening title sequence to The Living Daylights (1987) was filmed on Gibraltar. It was the fifteenth entry in the James Bond film series and the first to star Timothy Dalton as 007 James Bond. The film’s title was taken from Ian Fleming’s short story, “The Living Daylights“. It was the last film to use the title of an Ian Fleming story until the 2006 instalment Casino Royale.
http://www.filmnav.co.uk/2012/08/19/james-bond-and-gibraltar-filming-the-living-daylights/