Changeset 2920


Ignore:
Timestamp:
Sep 15, 2016, 4:15:21 PM (9 years ago)
Author:
bird
Message:

kWorker: small executable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kWorker/kWorker.c

    r2916 r2920  
    787787
    788788/** Create a larget BSS blob that with help of /IMAGEBASE:0x10000 should
    789  * cover the default executable link address of 0x400000. */
    790 #pragma section("DefLdBuf", write, execute, read)
    791 __declspec(allocate("DefLdBuf"))
     789 * cover the default executable link address of 0x400000.
     790 * @remarks Early main() makes it read+write+executable.  Attempts as having
     791 *          it as a separate section failed because the linker insists on
     792 *          writing out every zero in the uninitialized section, resulting in
     793 *          really big binaries. */
     794__declspec(align(0x1000))
    792795static KU8          g_abDefLdBuf[16*1024*1024];
    793796
     
    87838786        kFsCacheSetupCustomRevisionForTree(g_pFsCache, kFsCacheLookupA(g_pFsCache, pszTmp, &enmIgnored));
    87848787
     8788    /*
     8789     * Make g_abDefLdBuf executable.
     8790     */
     8791    if (!VirtualProtect(g_abDefLdBuf, sizeof(g_abDefLdBuf), PAGE_EXECUTE_READWRITE, &dwType))
     8792        return kwErrPrintfRc(3, "VirtualProtect(%p, %#x, PAGE_EXECUTE_READWRITE,NULL) failed: %u\n",
     8793                             g_abDefLdBuf, sizeof(g_abDefLdBuf), GetLastError());
     8794
    87858795#ifdef WITH_CONSOLE_OUTPUT_BUFFERING
    87868796    /*
Note: See TracChangeset for help on using the changeset viewer.