"

 Myabe both. According to this article it was written before the beatles were famous, but in a interview at the time of ""sgt pepper"" came out McCartney himself said he wrote it about him and Linda and how he hoped she would take care of him when he was 64. So, thought he may have written it long before he met her, i don't doubt that the origanal version was probably very diffrent to the final cut.  "