On Thu, 30 Mar 2023 at 12:16, Ni, Ray <ray...@intel.com> wrote: > > Andrew, > > In UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\, there are two nasm files: > ExceptionHandlerAsm.nasm and the other XCODE version. > > > > The major diff between the two is the second operand in “mov rax, > ASM_PFX(CommonInterruptEntry)” is patched at runtime by code, instead of > relying on linker/loader to fix it. > > Can I know more background why it’s needed for XCODE? > > > > Given Apple is switching away from X86 CPU, is the XCODE version still needed? > > > > + Mike because I found another commit by you for bug: 565 – Fix X64 > XCODE5/NASM compatibility issue in UefiCpuPkg MpInitLib (tianocore.org). > >
Yes, we still need it, also for non-Xcode clang + lld The problem is that the little code templates use absolute addressing to refer to the jump targets. This is necessary because these templates are copied into the vector table, and so they are moved independently from the code they refer to, and so relative addressing is not an option here. One thing I haven't tried yet is to emit the template code into .data instead of .text, which /should/ be fine given that the template code is never executed directly, only the copied versions are executed. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#102174): https://edk2.groups.io/g/devel/message/102174 Mute This Topic: https://groups.io/mt/97947477/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-