This is only needed in the case of dynamic linking and pthreads.
Previously these relocations were simply not be applied.
Also verified that this works using a more real world emscripten test:
https://github.com/emscripten-core/emscripten/pull/18641
This is perhaps a concerning change. The original line here was added without any test changes in: https://reviews.llvm.org/D112831. Its seems to lack test coverage although the new test I've add here adds coverage.
I also ran the entire emscripten test suite with this change to ensure this change doesn't break anything.