Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
[WebAssembly][lld] Fix crash when applying relocations to debug sections
Browse files Browse the repository at this point in the history
Debug sections are special in that they can contain relocations against
symbols that are not present in the final output (i.e. not live).
However it is also possible to have R_WASM_TABLE_INDEX relocations
against symbols that don't have a table index assigned (since they are
not address taken by actual code.

Fixes: emscripten-core/emscripten#9023

Differential Revision: https://reviews.llvm.org/D66435

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369423 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
sbc100 committed Aug 20, 2019
1 parent 92cf509 commit bda616b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/MC/MCParser/WasmAsmParser.cpp
Expand Up @@ -123,6 +123,7 @@ class WasmAsmParser : public MCAsmParserExtension {
// See use of .init_array in WasmObjectWriter and
// TargetLoweringObjectFileWasm
.StartsWith(".init_array", SectionKind::getData())
.StartsWith(".debug_", SectionKind::getMetadata())
.Default(Optional<SectionKind>());
if (!Kind.hasValue())
return Parser->Error(Lexer->getLoc(), "unknown section kind: " + Name);
Expand Down

0 comments on commit bda616b

Please sign in to comment.