Browse Source

FreezeTool: Make blob_size multiple of page size

A Mach-O segment must be sized in 4KiB increments. This shouldn't change
behavior for other platforms since mmap would round it up to hit a
page boundary anyway.
Donny Lawrence 5 years ago
parent
commit
23041ec069
1 changed files with 2 additions and 2 deletions
  1. 2 2
      direct/src/dist/FreezeTool.py

+ 2 - 2
direct/src/dist/FreezeTool.py

@@ -1810,8 +1810,8 @@ class Freezer:
 
         # Also determine the total blob size now.  Add padding to the end.
         blob_size = pool_offset + len(pool)
-        if blob_size & 31 != 0:
-            pad = (32 - (blob_size & 31))
+        if blob_size & (blob_align - 1) != 0:
+            pad = (blob_align - (blob_size & (blob_align - 1)))
             blob_size += pad
 
         # Calculate the offsets for the variables.  These are pointers,