diff options
| author | Sam Clegg <sbc@chromium.org> | 2019-05-21 09:13:09 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2019-05-21 09:13:09 +0000 |
| commit | 8fcf012693aeb25e29430bcbbf6a60f28f440357 (patch) | |
| tree | 0219f30b8ebe622f6b18d522b85ed2b6008b1b86 /lld/wasm/InputFiles.cpp | |
| parent | f33f1816785ab6085cfdc24cce7117c5e0d99559 (diff) | |
| download | bcm5719-llvm-8fcf012693aeb25e29430bcbbf6a60f28f440357.tar.gz bcm5719-llvm-8fcf012693aeb25e29430bcbbf6a60f28f440357.zip | |
[WebAssembly] Refactor synthetic sections and relocation processing. NFC.
Major refactor to better match the structure of the ELF linker.
- Split out relocation processing into scanRelocations
- Split out synthetic sections into their own classes.
Differential Revision: https://reviews.llvm.org/D61811
llvm-svn: 361233
Diffstat (limited to 'lld/wasm/InputFiles.cpp')
| -rw-r--r-- | lld/wasm/InputFiles.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp index 9699b8f49f7..b53818ca4da 100644 --- a/lld/wasm/InputFiles.cpp +++ b/lld/wasm/InputFiles.cpp @@ -75,7 +75,10 @@ uint32_t ObjFile::calcNewIndex(const WasmRelocation &Reloc) const { assert(TypeIsUsed[Reloc.Index]); return TypeMap[Reloc.Index]; } - return Symbols[Reloc.Index]->getOutputSymbolIndex(); + const Symbol *Sym = Symbols[Reloc.Index]; + if (auto *SS = dyn_cast<SectionSymbol>(Sym)) + Sym = SS->getOutputSectionSymbol(); + return Sym->getOutputSymbolIndex(); } // Relocations can contain addend for combined sections. This function takes a @@ -395,7 +398,7 @@ Symbol *ObjFile::createDefined(const WasmSymbol &Sym) { case WASM_SYMBOL_TYPE_SECTION: { InputSection *Section = CustomSectionsByIndex[Sym.Info.ElementIndex]; assert(Sym.isBindingLocal()); - return make<SectionSymbol>(Name, Flags, Section, this); + return make<SectionSymbol>(Flags, Section, this); } case WASM_SYMBOL_TYPE_EVENT: { InputEvent *Event = |

