One has to wonder, since the elves of Gondolin relied on staying hidden rather than killing orcs to keep their kingdom secret, how these swords acquired these fearsome reputations among the goblins. They were found in the troll-hoard where they had probably found their way after being kept in the hands of men of the North Kingdom of Arnor. During the wars with the Witch-King of Angmar, the swords (in the hands of new owners) could have added to their personal history.
Looking at a book like Beowulf for comparison, when the hero returns home to Geatland and tells of the upcoming marriage between Hrothgar's daughter and Ingeld's son, he predicts that the hope of an alliance through this marriage, ending the blood feud between the tribes, will fail for one main reason. Swords and armor were very valuable then and were not usually buried with the deceased. When you killed an enemy in battle, you were entitled to take his armor and arms and very often carried them yourself if they were superior to what you had. At the wedding and any other gatherings, relatives of the dead men were sure to see the arms of their loved ones being worn by their enemies and recognize them. The Heroic Code of the Saxons would demand that the death then be avenged. So in the past, people would know a particular sword and its history.
While Tolkien was a scholar in Anglo-Saxon and helped to popularize Beowulf, I think The Song of Roland is a part of where he drew his inspiration from in sword lore. Count Roland has a sword called 'Durendal'. There is no consensus on the meaning of the name (I think it sounds like 'hard steel') but in it's golden hilt is embedded St. Peter's tooth, blood of St. Basil, hair from St. Denis and a part of the raiment of Mary, mother of Jesus. He also bore a horn called the Oliphant which, when they were attacked and the battle turned against them, he sounded to summon Charlemagne with the main part of the army. Charlemagne heard the horn 30 leagues away but was at first persuaded that it was nothing. The Saracens, at first dismayed but seeing that no one came, continued their assault. (Sounds like Boromir?) Two more times Roland blew his horn and on the third blast, Charlemagne was convinced Roland was in danger and turned around. The Franks heard the horn two more times as they hurried back, the last blow sounding weak and they knew Roland was dying. All of his men were dead and he did not want his sword to fall into the hands of the infidels so he tried to break it. It was unbreakable. Charlemagne found him dead with his sword under him, covered with wounds that showed how bravely he fought against so many.
The sword of Roland with all its fabulous relics did not belong to Charlemagne because the king had a better relic embedded in the pommel of his sword, Jouise or Joyous - the tip of the Spear of Destiny also known as the Spear of Longinus. This sword changed color thirty times a day. Charlemagne's war cry was 'Monjoie" meaning 'My Joy' from his sword rather like Aragorn's war cry of 'Anduril'. Aragorn's sword name seems like it may be an anagram of Roland's sword but if that is not convincing enough that The Song of Roland influenced Tolkien (among other works) while writing Lord of the Rings, consider this: the enemy responsible for the attack that killed Roland, an emir named Baligant, who fought with Charlemagne and died at his hands, had a sword that he called Precuise or 'Precious'. It was his battle cry. One could imagine him dying with a shriek of 'Precious' but it would cause one to giggle slightly and deny the solemnity of the moment. Gollum, gollum.