[PATCH] D75081: [CodeView] Align type records on 4-bytes when emitting PDBs

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 06:51:55 PDT 2020


aganea marked 2 inline comments as done.
aganea added a comment.

Thanks for reviewing this Reid!



================
Comment at: lld/test/COFF/pdb-tpi-aligned-records.test:21
+    # and that triggers an alignement bug in the output .PDB.
+    SectionData:     '040000001000081003000000000000000000000000000600011200000000'
+    Types:
----------------
rnk wrote:
> Are you sure we don't ignore SectionData? If you confirm the test fails if you remove the LF_PAD code before committing, that's good enough for me.
> 
> I guess to be doubly sure we could remove the `Types:` block below. I would expect yaml2obj to fall back to SectionData.
If I comment out `SectionData:`, the test fails because the TPI record now starts with `0E000810` (the source Type stream is generated by LLVM) instead of `12000810` (the source Type stream is generated by NASM). This is because NASM generates wrongly-sized LF_PROCEDURE records, I've filled a bug here: https://bugzilla.nasm.us/show_bug.cgi?id=3392651
The `SectionData:` stream above was copy-pasted from a NASM-generated OBJ file.

If I remove the changes to the code, the test fails, and the records after become unaligned:
{F11530676}

I only left `Types:` for information purposes, but I can comment it out, to make it obvious that the `SectionData:` is used.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75081/new/

https://reviews.llvm.org/D75081





More information about the llvm-commits mailing list