[all-commits] [llvm/llvm-project] a73252: [CodeView] Align type records on 4-bytes when emit...

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Fri Mar 13 09:22:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a7325298e1f311b383b8ce5ba8e2d3698fef472a
      https://github.com/llvm/llvm-project/commit/a7325298e1f311b383b8ce5ba8e2d3698fef472a
  Author: Alexandre Ganea <alexandre.ganea at ubisoft.com>
  Date:   2020-03-13 (Fri, 13 Mar 2020)

  Changed paths:
    A lld/test/COFF/pdb-tpi-aligned-records.test
    M llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
    M llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp
    M llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
    M llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp

  Log Message:
  -----------
  [CodeView] Align type records on 4-bytes when emitting PDBs

When emitting PDBs, the TypeStreamMerger class is used to merge .debug$T records from the input .OBJ files into the output .PDB stream.
Records in .OBJs are not required to be aligned on 4-bytes, and "The Netwide Assembler 2.14" generates non-aligned records.

When compiling with -DLLVM_ENABLE_ASSERTIONS=ON, an assert was triggered in MergingTypeTableBuilder when non-ghash merging was used.
With ghash merging there was no assert.
As a result, LLD could potentially generate a non-aligned TPI stream.

We now align records on 4-bytes when record indices are remapped, in TypeStreamMerger::remapIndices().

Differential Revision: https://reviews.llvm.org/D75081




More information about the All-commits mailing list