Currently, when creating a named "section", the Wasm frontend forces it to use SectionKind::Data, whereas in fact C++ does generate code sections.
I can see how this got here - there's a default implementation in TargetLoweringObjectFile::getKindForGlobal which returns all sorts of different section kinds to save duplicating that for each target. Most of those section types are not appropriate for Wasm.
We do however need to be able to create code sections for C++.
To help me understand how this all fits together, can you describe the circumstances in which this implementation returns a different value than just { return K; } would?