[PATCH] D42937: [DWARF] Make llvm-dwp handle DWARF v5 string offsets tables and indexed strings.

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 16:37:08 PST 2018


wolfgangp created this revision.
wolfgangp added a reviewer: dblaikie.
Herald added subscribers: mgrang, JDevlieghere, aprantl.

llvm-dwp needs to remap string offsets from input .dwo or .dwp files and therefore needs to be made aware of DWARF v5 string offsets tables now that llvm generates them. Unlike the pre-v5 GNU-style string offsets tables, DWARF v5 string offsets tables have a header describing length, format and version of the table. This patch preserves the header and performs some simple validation when it rewrites the string offsets table contributions.
 It also makes llvm-dwp handle v5 compile unit headers.

One thing to note is that the current implementation recreates the string offsets table in one single loop over the entire string offsets section. Since we want to support a mixture of v5 and pre-v5 CUs, we can't parse the section without knowing where the pre-v5 units' contributions are. This is a similar problem as in llvm-dwarfdump, so we go unit by unit in re-writing the table.


https://reviews.llvm.org/D42937

Files:
  test/tools/llvm-dwp/Inputs/string_offsets/a.ll
  test/tools/llvm-dwp/Inputs/string_offsets/b.ll
  test/tools/llvm-dwp/Inputs/string_offsets/c.ll
  test/tools/llvm-dwp/X86/dwp-string-offsets-invalid-1.s
  test/tools/llvm-dwp/X86/dwp-string-offsets-invalid-2.s
  test/tools/llvm-dwp/X86/dwp-string-offsets-invalid-3.s
  test/tools/llvm-dwp/X86/invalid_string_form.test
  test/tools/llvm-dwp/X86/string_offsets.test
  tools/llvm-dwp/llvm-dwp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42937.132902.patch
Type: text/x-patch
Size: 33832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/b88328e4/attachment.bin>


More information about the llvm-commits mailing list