[PATCH] D85685: [WIP] Support dwarf fission for wasm object files

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 13:24:47 PDT 2020


dschuff created this revision.
dschuff added reviewers: sbc100, aardappel.
Herald added subscribers: llvm-commits, cfe-commits, sunfish, hiraditya, aprantl.
Herald added projects: clang, LLVM.
dschuff requested review of this revision.
Herald added a subscriber: aheejin.

Initial support for dwarf fission sections (-gsplit-dwarf) on wasm.
The most interesting change is support for writing 2 files (.o and .dwo) in the
wasm object writer. My approach moves object-writing logic into its own function
and calls it twice, swapping out the endian::Writer (W) in between calls.
(This is a bit different than the ELF writer's approach. I like it a bit better
but don't have a strong opinion).

This patch has the basic structure and writes separate files containing
non-dwo and dwo sections. There are couple of other things needed:

1. Linker support for an equivalent of ELF's SHF_EXCLUDE to keep the debug sections from being linked
2. a few checks and validations (equivalent to the places where the ELF object writer checks the dwo mode, such as validating relocs)

These can go in future CLs, but I still need to add some tests to this one.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85685

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  llvm/lib/MC/MCAsmBackend.cpp
  llvm/lib/MC/MCObjectFileInfo.cpp
  llvm/lib/MC/WasmObjectWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85685.284490.patch
Type: text/x-patch
Size: 7039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200810/266f05e7/attachment.bin>


More information about the llvm-commits mailing list