From 07da1ac8c46425cb401cc5f356ab77b9cc1c334d Mon Sep 17 00:00:00 2001 From: Anderw Fish Date: Tue, 9 Sep 2014 06:50:51 +0000 Subject: UefiCpuPkg: CpuExceptionHandlerLib: Make self modifying code work with Xcode CpuExceptionHandlerLib has code that contains absolute relocations, not supported by Xcode for X64, and it then copies this code to an alternate location in memory. It is very hard to write IP relative self-modifiying code. I had to update AsmVectorNumFixup() to also patch in the absolute addressess after the code was copied. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Anderw Fish Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16068 6f19259b-4bc3-4df7-8a09-765794883524 --- UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S | 2 +- UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32') diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S index 387b4b26bf..e19afbe14d 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.S @@ -632,7 +632,7 @@ ASM_PFX(AsmGetTemplateAddressMap): popl %ebp ret #------------------------------------------------------------------------------------- -# AsmVectorNumFixup (*VectorBase, VectorNum); +# AsmVectorNumFixup (*NewVectorAddr, VectorNum, *OldVectorAddr); #------------------------------------------------------------------------------------- ASM_GLOBAL ASM_PFX(AsmVectorNumFixup) ASM_PFX(AsmVectorNumFixup): diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm index 74d4e89047..3ff01b2a0c 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.asm @@ -434,7 +434,7 @@ AsmGetTemplateAddressMap proc near public AsmGetTemplateAddressMap ENDP ;------------------------------------------------------------------------------------- -; AsmVectorNumFixup (*VectorBase, VectorNum); +; AsmVectorNumFixup (*NewVectorAddr, VectorNum, *OldVectorAddr); ;------------------------------------------------------------------------------------- AsmVectorNumFixup proc near public mov eax, dword ptr [esp + 8] -- cgit v1.2.3