Skip to content

Commit

Permalink
[x86/Linux] add three functions for _X86_TARGET_ (dotnet#10378)
Browse files Browse the repository at this point in the history
* [x86/Linux] add three functions for _X86_TARGET_

There is no functions for _X86_TARGET_.
  - ZapUnwindData::GetAlignment()
  - DWORD ZapUnwindData::GetSize()
  - void ZapUnwindData::Save(ZapWriter * pZapWriter)

* [x86/Linux] remove personality routine on x86/linux.

	remove creating personaly routine when assemblies is generated to ni.
	add a function for getting size of UnwindDataBlob on x86/linux.

Signed-off-by: ragmani <ragmani0216@gmail.com>

* [x86/Linux] correct the unclearly fixed parts.

change Unwindinfo's size from sizeof(ULONG) to sizeof(UNWIND_INFO).
change Unwindinfo's alignment from sizeof(DWORD) to sizeof(BYTE).
remove unnecessary code.

* [x86/Linux] change alignment from sizeof(BYTE) to sizeof(DWORD).
  • Loading branch information
ragmani authored and janvorli committed Apr 5, 2017
1 parent a5fef21 commit c7241a9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/inc/daccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,10 @@ typedef DPTR(IMAGE_TLS_DIRECTORY) PTR_IMAGE_TLS_DIRECTORY;
#include <xclrdata.h>
#endif

#if defined(_TARGET_X86_) && defined(FEATURE_PAL)
typedef DPTR(struct _UNWIND_INFO) PTR_UNWIND_INFO;
#endif

#ifdef _WIN64
typedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;
typedef DPTR(struct _UNWIND_INFO) PTR_UNWIND_INFO;
Expand Down
7 changes: 7 additions & 0 deletions src/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,13 @@ PTR_VOID GetUnwindDataBlob(TADDR moduleBase, PTR_RUNTIME_FUNCTION pRuntimeFuncti

return pUnwindInfo;

#elif defined(_TARGET_X86_) && defined(FEATURE_PAL)
PTR_UNWIND_INFO pUnwindInfo(dac_cast<PTR_UNWIND_INFO>(moduleBase + RUNTIME_FUNCTION__GetUnwindInfoAddress(pRuntimeFunction)));

*pSize = ALIGN_UP(sizeof(UNWIND_INFO), sizeof(DWORD));

return pUnwindInfo;

#elif defined(_TARGET_ARM_)

// if this function uses packed unwind data then at least one of the two least significant bits
Expand Down
24 changes: 24 additions & 0 deletions src/zap/zapcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,30 @@ void ZapUnwindData::Save(ZapWriter * pZapWriter)
#endif //REDHAWK
}

#elif defined(_TARGET_X86_) && defined(FEATURE_PAL)

UINT ZapUnwindData::GetAlignment()
{
return sizeof(BYTE);
}

DWORD ZapUnwindData::GetSize()
{
DWORD dwSize = ZapBlob::GetSize();

return dwSize;
}

void ZapUnwindData::Save(ZapWriter * pZapWriter)
{
ZapImage * pImage = ZapImage::GetImage(pZapWriter);

PVOID pData = GetData();
DWORD dwSize = GetBlobSize();

pZapWriter->Write(pData, dwSize);
}

#elif defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)

UINT ZapUnwindData::GetAlignment()
Expand Down

0 comments on commit c7241a9

Please sign in to comment.