From 19ee4a904982cfacdcb8c578c5d421162fa9488d Mon Sep 17 00:00:00 2001 From: Anderw Fish Date: Tue, 9 Sep 2014 06:27:45 +0000 Subject: [PATCH] SourceLevelDebugPkg: DebugAgentLib: Fix clang/Xcode 5 compile/link errors Move ExceptionStubHeaderSize from 16 to 32 bits to work around clang relocation limitation. Use movw, not move for 32-bit segment register operations. 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@16067 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DebugAgent/DebugAgentCommon/DebugAgent.h | 2 +- .../DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S | 2 +- .../DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm | 2 +- .../Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S | 10 +++++----- .../DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h index 6f1d3e5aab..53d96609be 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h @@ -67,7 +67,7 @@ extern UINTN Exception0Handle; extern UINTN TimerInterruptHandle; -extern UINT16 ExceptionStubHeaderSize; +extern UINT32 ExceptionStubHeaderSize; extern BOOLEAN mSkipBreakpoint; extern EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[]; extern UINTN mVectorHandoffInfoCount; diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S index 284939126f..efeaebc2c8 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.S @@ -33,7 +33,7 @@ ASM_GLOBAL ASM_PFX(CommonEntry) .data -ASM_PFX(ExceptionStubHeaderSize): .word ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle) +ASM_PFX(ExceptionStubHeaderSize): .long ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle) .text diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm index 9b219fc07d..2aaf5b7b4c 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/Ia32/AsmFuncs.asm @@ -38,7 +38,7 @@ ENDM .data -ExceptionStubHeaderSize DW Exception1Handle - Exception0Handle +ExceptionStubHeaderSize DD Exception1Handle - Exception0Handle CommonEntryAddr DD CommonEntry .code diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S index 365bc940fe..276f036a83 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.S @@ -34,7 +34,7 @@ ASM_GLOBAL ASM_PFX(CommonEntry) .data -ASM_PFX(ExceptionStubHeaderSize): .word ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle) +ASM_PFX(ExceptionStubHeaderSize): .long ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle) .text @@ -271,13 +271,13 @@ NoExtrPush: movzwq 32(%rbp), %rax # movq %cs, %rax pushq %rax - movq %ds, %rax + movw %ds, %rax pushq %rax - movq %es, %rax + movw %es, %rax pushq %rax - movq %fs, %rax + movw %fs, %rax pushq %rax - movq %gs, %rax + movw %gs, %rax pushq %rax ## UINT64 Rip; diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm index cf8c5f0194..0f076a76da 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/X64/AsmFuncs.asm @@ -32,7 +32,7 @@ AGENT_HANDLER_SIGNATURE MACRO db 41h, 47h, 54h, 48h ; SIGNATURE_32('A','G','T','H') ENDM -ExceptionStubHeaderSize dw Exception1Handle - Exception0Handle ; +ExceptionStubHeaderSize dd Exception1Handle - Exception0Handle ; CommonEntryAddr dq CommonEntry ; .code