I believe for other architectures, when the linker emits debug info for a dead function, it treats relocations pointing a dead section as if it were pointing to address zero. Is there any reason to do that differnetly for wasm?
Jul 18 2018
Jul 17 2018
Jul 16 2018
Per discussion at the WebAssembly toolchain meeting, this solution is too complex. I going to close this WIP in favor more simple solutions such as disabling debug info during optimization, or moving optimization out of the lld.
Do you happen to have a smaller/reduced reproducer?
- Reducing the test case further: remove attributes, lifetime markers and non-"a" variable metadata.
- Add test for MoveAndTeeForMultiUse changes
Reducing the test case further: remove attributes, lifetime markers and non-"a" variable metadata.
- Use valueOut() instead of valueDefined()
- Make the debug value special case more obvious
Jul 11 2018
Fix DBG_VALUE instruction cloning.
Jul 9 2018
- add asserts for MI
- run clang-format
- comment rewording
Jul 6 2018
Jul 5 2018
Jun 7 2018
What I meant is to continue using the bytecode offset as before, but count "bytecode offset" in the fully expanded form instead of the raw in-file form. So, any LEB128 number is counted as 5 byte long. Then, that "virtual bytecode offset" should exactly match the original, uncompressed byte code offset, eliminating the need of adjusting any byte offset in DWARF.
There's no notion of "PC" in wasm, no? You cannot take an address of a function and call it indirectly later. Well, you can do that, but what you get is not an address in the regular mean. It's an index, if I understand correctly. So, by PC, what do you mean?
It looks like your patch recognizes all DWARF records that contains in-file offsets to adjust them. Is this the right approach? If DWARF is extended (that happens fairly frequently), do you have to make a change to the linker to produce non-broken debug info? If that's the case, I think it is too fragile.
I there a way we can avoid needing to do this at all? How about we simply don't allow LEB compression and dwarf in the same output? It seems OK if building with dwarf in them don't have this optimization.
May 22 2018
Looks good. Thank you.
The test at D46416 tests this -- it was a luck that the unset buffer (Buf) contains mostly right values.
Yes, is does. Large binary demo I have now runs without issue.
May 16 2018
May 15 2018
May 14 2018
May 11 2018
May 7 2018
May 4 2018
Remove isa<SectionSymbol> check
May 3 2018
Remove startswith(".debug") checks
Refactor SectionSymbol (remove CombinedSection and DefinedSection)
Move CombinedSectionSymbols creation
May 2 2018
Simplify assignSymtab for CombinedSectionSymbols
Fix createCustomSections for non-referred sections
Looks good to me. Thanks
May 1 2018
Remove tracking of InputSection from Symtab.
Apr 27 2018
Apr 26 2018
The change is good (and looks identical to one in D45118). Thank you
Rebase on top of D46092
Apr 25 2018
Rebase on top of D45795
Replace SectionIndex (with ElementIndex)
Rebase to D45980 attempt.
Apr 23 2018
Looks good to me. Does it make sense to check/assert in parseRelocSection what type of section is referred to -- just to ensure we are dealing with CODE and DATA sections (while we have multiple reloc section formats in the wild)?
Apr 19 2018
Fix debug-info.ll test -- custom section sizes
Remove .Lsection_start from obj reader
Fix debug section filter
Remove isDebug and simplify SectionName
Apr 18 2018
Remove "Debug information is not supported" comment.
Apr 16 2018
Add dwarfdump test
Rebase at D45579
Rebase at D45579.
Address review comments.
Apr 13 2018
This makes sense. Thank you for the patch.
Apr 12 2018
Addresses recordRelocation review
Fix test/tools/llvm-objdump/wasm.txt and test/MC/WebAssembly/debug-info.ll tests
Looks good to me. I would also add error check to ensure that name fits into the section.
Rebase on top of D45340
Apr 10 2018
Fix tests at test/MC/WebAssembly/
Rebase on top of D45297
Apr 9 2018
Looks good to me (from D45118 point of view)
Apr 5 2018
Update style via clang-format
Don't export DefinedSection symbols.
If its OK with you I'm going to try and split off the generic custom section handling and land that first. See https://reviews.llvm.org/D45297
Apr 3 2018
Fixes llvm-dwarfdump tools for wasm files w/DWARF sections
For a patch like this, I'd like to know the overview of the debug story in the wasm world first, so that I can review this patch in that story line. I can imagine a lot of different strategies to enable debug info for wasm... I'd be really helpful if you share your plan.
Apr 2 2018
Mar 30 2018
Use proper symbol offset when hoisting symbols.
Mar 29 2018
Fix patching relocations for custom/debug sections.
Fix code style
Mar 15 2018
Changes std::unordered_set to StringSet
Comment for patching XXX_OFFSET_I32 relocations
Minor fixes for reading section symbols
Move test to the test/DebugInfo/WebAssembly and add C code source.
Update obj2yaml/yaml2obj support for custom DWARF sections
Mar 14 2018
Update llvm-readobj to support reading section symbols and new relocations.
Add test description.