]> git.saurik.com Git - ldid.git/commitdiff
Support signing binaries without any symbol table.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 31 Dec 2017 10:07:16 +0000 (02:07 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 31 Dec 2017 10:07:16 +0000 (02:07 -0800)
ldid.cpp

index 08ac3a3ca4c89d0ad3cf1c143291c30e740da7a0..1f9287ce59884a68fcada53e13390e67ae4ef564 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -1220,9 +1220,11 @@ static void Allocate(const void *idata, size_t isize, std::streambuf &output, co
 
         if (symtab != NULL) {
             auto end(mach_header.Swap(symtab->stroff) + mach_header.Swap(symtab->strsize));
-            _assert(end <= size);
-            _assert(end >= size - 0x10);
-            size = end;
+            if (symtab->stroff != 0 || symtab->strsize != 0) {
+                _assert(end <= size);
+                _assert(end >= size - 0x10);
+                size = end;
+            }
         }
 
         size_t alloc(allocate(mach_header, size));