[PATCH] D45118: Linking debug (DWARF) sections from the WebAssembly object files

Yury Delendik via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 11:37:27 PDT 2018


yurydelendik marked an inline comment as done.
yurydelendik added inline comments.


================
Comment at: wasm/InputFiles.cpp:139
+    if (auto *Sym = dyn_cast<DefinedSection>(getSectionSymbol(Reloc.Index))) {
+      const SymbolTable::InputFilesSectionsSet &SectionsSet =
+          Symtab->InputFilesSections[Sym->SectionIndex];
----------------
sbc100 wrote:
> Maybe I'm missing something but SymbolTable seems like the wrong place to store this. 
> What do you think about my last comments about how these symbols should be local and therefore not be added to symbol table at all?
> 
> Why can't you just replace this code with ?
> ```
> InputSection* IS = CustomSectionsByIndex[Sym->SectionIndex];
> return IS->OutputOffset + Reloc.Addend;
> ```
> 
> I'm probably missing something here.
> 
> What do you think about my last comments about how these symbols should be local and therefore not be added to symbol table at all?

Yeah, I'm trying to figure this out atm

> Why can't you just replace this code with ?

Index CustomSectionsByIndex in expectes InputFile section index, but Sym->SectionIndex just contains index for symbol data (not associated with output or input section index).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D45118





More information about the llvm-commits mailing list