-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working with msvc, to test again on gcc
- Loading branch information
1 parent
1704732
commit 9b46cb8
Showing
8 changed files
with
106 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2074,7 +2074,7 @@ DEFINE GCC_DEPS_FLAGS = -MMD -MF [email protected] | |
DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings | ||
DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 | ||
DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -fno-omit-frame-pointer | ||
DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -fno-omit-frame-pointer | ||
DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fstack-protector-strong -mstack-protector-guard=global "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -fno-omit-frame-pointer | ||
DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable | ||
DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive | ||
DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ StackCheckFailure ( | |
VOID | ||
) | ||
{ | ||
DEBUG ((DEBUG_ERROR, "First Stack Cookie Exception Call!\n")); | ||
return; | ||
} |
29 changes: 0 additions & 29 deletions
29
MdePkg/Library/StackCheckLib/IA32/StackCheckFunctionsMsvc.asm
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
MdePkg/Library/StackCheckLib/IA32/StackCheckFunctionsMsvc.nasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
;------------------------------------------------------------------------------ | ||
; IA32/StackCheckFunctionsMsvc.asm | ||
;------------------------------------------------------------------------------ | ||
|
||
DEFAULT REL | ||
SECTION .text | ||
|
||
extern ASM_PFX(__security_cookie) | ||
extern ASM_PFX(StackCheckFailure) | ||
extern ASM_PFX(CpuDeadLoop) | ||
|
||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __report_rangecheckfailure (VOID); | ||
;------------------------------------------------------------------------------ | ||
global ASM_PFX(__report_rangecheckfailure) | ||
ASM_PFX(__report_rangecheckfailure): | ||
call ASM_PFX(CpuDeadLoop) | ||
ret | ||
|
||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __GSHandlerCheck (VOID); | ||
;------------------------------------------------------------------------------ | ||
global ASM_PFX(__GSHandlerCheck) | ||
ASM_PFX(__GSHandlerCheck): | ||
call ASM_PFX(CpuDeadLoop) | ||
ret | ||
|
||
;------------------------------------------------------------------------------ | ||
; Checks the stack cookie value against __security_cookie and calls the | ||
; stack cookie failure handler if there is a mismatch. | ||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __security_check_cookie ( | ||
; IN UINTN CheckValue); | ||
;------------------------------------------------------------------------------ | ||
global @__security_check_cookie@4 | ||
@__security_check_cookie@4: | ||
cmp ecx, [ASM_PFX(__security_cookie)] | ||
jne security_check_cookie_failure | ||
ret | ||
|
||
security_check_cookie_failure: | ||
call ASM_PFX(StackCheckFailure) | ||
int FixedPcdGet8 (PcdStackCookieExceptionVector) | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
MdePkg/Library/StackCheckLib/X64/StackCheckFunctionsMsvc.asm
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
MdePkg/Library/StackCheckLib/X64/StackCheckFunctionsMsvc.nasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
;------------------------------------------------------------------------------ | ||
; X64/StackCheckFunctionsMsvc.asm | ||
;------------------------------------------------------------------------------ | ||
|
||
DEFAULT REL | ||
SECTION .text | ||
|
||
extern ASM_PFX(StackCheckFailure) | ||
extern ASM_PFX(__security_cookie) | ||
extern ASM_PFX(CpuDeadLoop) | ||
|
||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __report_rangecheckfailure (VOID); | ||
;------------------------------------------------------------------------------ | ||
global ASM_PFX(__report_rangecheckfailure) | ||
ASM_PFX(__report_rangecheckfailure): | ||
call ASM_PFX(CpuDeadLoop) | ||
ret | ||
|
||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __GSHandlerCheck (VOID); | ||
;------------------------------------------------------------------------------ | ||
global ASM_PFX(__GSHandlerCheck) | ||
ASM_PFX(__GSHandlerCheck): | ||
call ASM_PFX(CpuDeadLoop) | ||
ret | ||
|
||
|
||
;------------------------------------------------------------------------------ | ||
; Checks the stack cookie value against __security_cookie and calls the | ||
; stack cookie failure handler if there is a mismatch. | ||
;------------------------------------------------------------------------------ | ||
; VOID | ||
; EFIAPI | ||
; __security_check_cookie ( | ||
; IN UINTN CheckValue); | ||
;------------------------------------------------------------------------------ | ||
global ASM_PFX(__security_check_cookie) | ||
ASM_PFX(__security_check_cookie): | ||
cmp rcx, [ASM_PFX(__security_cookie)] | ||
jne security_check_cookie_failure | ||
ret | ||
|
||
security_check_cookie_failure: | ||
call StackCheckFailure | ||
int FixedPcdGet8 (PcdStackCookieExceptionVector) | ||
ret |