[VCRUNTIME][VCSTARTUP] Add separate vcruntime and vcstartup lib

vcruntime contains the code that is linked into ucrtbase (in VS it is also provided as vcruntime140.dll)
vcstartup contains the code that is statically linked into executables that link to ucrtbase.dll. In Visual Studio this is part of msvcrt.lib (the import library for msvcrt), similar to our current msvcrtex, and it gets linked when you link to ucrtbase as well. The name is based on the folder name in the library.
Both libraries share some code, but each file is only compiled once.
This commit is contained in:
Timo Kreuzer 2025-01-17 11:45:05 +02:00
parent 2b2bdabe72
commit 9186b861a6
21 changed files with 79 additions and 26 deletions

View file

@ -0,0 +1,27 @@
//
// __security_check_cookie.asm
//
// Copyright (c) 2024 Timo Kreuzer
//
// Implementation of __security_check_cookie for x86.
//
// SPDX-License-Identifier: MIT
//
#include <asm.inc>
EXTERN ___security_cookie:QWORD
EXTERN ___report_gsfailure:PROC
.code
// This function must not clobber any registers!
PUBLIC ___security_check_cookie
___security_check_cookie:
cmp ecx, dword ptr [___security_cookie]
jne ___security_check_cookie_fail
ret
___security_check_cookie_fail:
jmp ___report_gsfailure
END