Legolas and gimli, canonically and literally, sailed off into the sunset together after spending a hundred years traveling the world side by side, and Gimli was the only dwarf ever to be given passage to the uttermost west without entering the halls of the god of death.
Legolas isn't just gay-coded. I won't try and claim that Tolkien intended it, but death of the author dictates that the text stands on its own, and those two stand as life partners in the text.
❤️ 1