It could tie in with the sons of the soil idea.
Surnames in English started after the 1066 Norman invasion, and places where people came from were one source. 'Son of a gun' may originally have been a term for babies born to prostitutes aboard navy ships where paternity was uncertain. 'Son' features in names like Johnson, and Fitz- means 'son of'.
It might, therefore, be a bit of both- characteristics, locations, etc, were turned into names, which would have legal significance.