This was always the intended behavior, but had not been
implemented. This ordering is important for Emscripten when generating
.mem files while compiling to JS, since only zeros at the end of
initialized memory can be dropped.
Fixes https://github.com/emscripten-core/emscripten/issues/8999
Its possible to have custom segment names. See Writer.cpp:getOutputDataSegmentName. Seems strange that no tests use this feature though .. maybe I'm misunderstanding something?
Perhaps just create a partial order that puts bss last?