[lld][WebAssembly] Fix for string tail merging and -r/--relocatable
authorSam Clegg <sbc@chromium.org>
Wed, 19 May 2021 20:33:24 +0000 (13:33 -0700)
committerSam Clegg <sbc@chromium.org>
Wed, 19 May 2021 22:25:58 +0000 (15:25 -0700)
commit356b85edd78311ae7376f4b271c48b9f0156aeea
tree11394c208d1d560283e4d58557814ed35e73d2cf
parentc9dbaa4c86d29f891e2c30af787dfb74b9e83ed9
[lld][WebAssembly] Fix for string tail merging and -r/--relocatable

Ensure that both SyntheticMergedChunk and all MergeInfoChunks that it
comprises are assigned the correct output section.  Without this we
would crash when outputting relocations in --relocatable mode.

Fixes: https://github.com/emscripten-core/emscripten/issues/14220

Differential Revision: https://reviews.llvm.org/D102806
lld/test/wasm/merge-string-debug.s
lld/wasm/OutputSections.cpp