diff options
author | Sam Clegg <sbc@chromium.org> | 2021-05-01 15:37:40 -0700 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2021-05-03 16:43:29 -0700 |
commit | 73332d73e15f4fdf8e4240c585d0a334f23926f3 (patch) | |
tree | 0173ca43d69dc9dbb08336e563afe6a07d7d531f /llvm/lib/Object/WasmObjectFile.cpp | |
parent | e38ccb729b205b076356684e055efb7dfc673963 (diff) | |
download | llvm-73332d73e15f4fdf8e4240c585d0a334f23926f3.zip llvm-73332d73e15f4fdf8e4240c585d0a334f23926f3.tar.gz llvm-73332d73e15f4fdf8e4240c585d0a334f23926f3.tar.bz2 |
[lld][WebAssembly] Do not merge comdat data segments
When running in relocatable mode any input data segments that are part
of a comdat group should not be merged with other segments of the same
name. This is because the final linker needs to keep the separate so
they can be included/excluded individually.
Often this is not a problem since normally only one section with a given
name `foo` ends up in the output object file. However, the problem
occurs when one input contains `foo` which part of a comdat and another
object contains a local symbol `foo` we were attempting to merge them.
This behaviour matches (I believe) that of the ELF linker. See
`LinkerScript.cpp:addInputSec`.
Fixes: https://github.com/emscripten-core/emscripten/issues/9726
Differential Revision: https://reviews.llvm.org/D101703
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/WasmObjectFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index b7bf770..946721a 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -39,8 +39,8 @@ using namespace object; void WasmSymbol::print(raw_ostream &Out) const { Out << "Name=" << Info.Name - << ", Kind=" << toString(wasm::WasmSymbolType(Info.Kind)) - << ", Flags=" << Info.Flags; + << ", Kind=" << toString(wasm::WasmSymbolType(Info.Kind)) << ", Flags=0x" + << Twine::utohexstr(Info.Flags); if (!isTypeData()) { Out << ", ElemIndex=" << Info.ElementIndex; } else if (isDefined()) { |