Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Port StubLinkerCPU::EmitSetup #8494

Merged
merged 1 commit into from
Dec 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/vm/i386/stublinkerx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,6 @@ VOID StubLinkerCPU::EmitSetup(CodeLabel *pForwardRef)
{
STANDARD_VM_CONTRACT;

#ifndef FEATURE_PAL
#ifdef FEATURE_IMPLICIT_TLS
DWORD idx = 0;
TLSACCESSMODE mode = TLSACCESS_GENERIC;
Expand All @@ -2889,13 +2888,17 @@ VOID StubLinkerCPU::EmitSetup(CodeLabel *pForwardRef)
switch (mode)
{
case TLSACCESS_WNT:
#ifndef FEATURE_PAL
{
unsigned __int32 tlsofs = offsetof(TEB, TlsSlots) + (idx * sizeof(void*));

static const BYTE code[] = {0x64,0x8b,0x1d}; // mov ebx, dword ptr fs:[IMM32]
EmitBytes(code, sizeof(code));
Emit32(tlsofs);
}
#else // !FEATURE_PAL
_ASSERTE("TLSACCESS_WNT mode is not supported");
#endif // !FEATURE_PAL
break;

case TLSACCESS_GENERIC:
Expand Down Expand Up @@ -2926,10 +2929,6 @@ VOID StubLinkerCPU::EmitSetup(CodeLabel *pForwardRef)
X86EmitDebugTrashReg(kECX);
X86EmitDebugTrashReg(kEDX);
#endif

#else // FEATURE_PAL
PORTABILITY_ASSERT("StubLinkerCPU::EmitSetup");
#endif // FEATURE_PAL
}

VOID StubLinkerCPU::EmitRareSetup(CodeLabel *pRejoinPoint, BOOL fThrow)
Expand Down