[lld] r328812 - [MSF] Default to FPM2, and always mark FPM pages allocated.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 11:34:15 PDT 2018


Author: zturner
Date: Thu Mar 29 11:34:15 2018
New Revision: 328812

URL: http://llvm.org/viewvc/llvm-project?rev=328812&view=rev
Log:
[MSF] Default to FPM2, and always mark FPM pages allocated.

There are two FPMs in an MSF file, the idea being that for
incremental updates you can write to the alternate one and then
atomically swap them on commit.  LLVM defaulted to using FPM1
on the first commit, but this differs from Microsoft's behavior
which is to default to using FPM2 on the first commit.  To
eliminate some byte-level file differences, this patch changes
LLVM's default to also be FPM2.

Additionally, LLVM was trying to be "smart" about marking FPM
pages allocated.  In addition to marking every page belonging
to the alternate FPM as unallocated, LLVM also marked pages at
the end of the main FPM which were not needed as unallocated.

In order to match the behavior of Microsoft-generated PDBs, we
now always mark every FPM block as allocated, regardless of
whether it is in the main FPM or the alt FPM, and regardless of
whether or not it describes blocks which are actually in the file.

This has the side benefit of simplifying our code.

Modified:
    lld/trunk/test/COFF/pdb.test

Modified: lld/trunk/test/COFF/pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb.test?rev=328812&r1=328811&r2=328812&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb.test (original)
+++ lld/trunk/test/COFF/pdb.test Thu Mar 29 11:34:15 2018
@@ -14,7 +14,7 @@
 # CHECK:      MSF:
 # CHECK-NEXT:   SuperBlock:
 # CHECK-NEXT:     BlockSize:       4096
-# CHECK-NEXT:     FreeBlockMap:    1
+# CHECK-NEXT:     FreeBlockMap:    2
 # CHECK-NEXT:     NumBlocks:
 # CHECK-NEXT:     NumDirectoryBytes:
 # CHECK-NEXT:     Unknown1:        0




More information about the llvm-commits mailing list