Share via


SH-4 pdata Format

The Microsoft Common Object File Format (COFF) specifies a pdata section that contains an array of function table entries for exception handling, and is pointed to by the exception table entry in the image data directory. The SH-4 Calling Sequence Specification supports a PDATA structure, _IMAGE_CE_RUNTIME_FUNCTION_ENTRY, to aid in stack walking at run-time. This structure aids in debugging and exception processing.

The data structure is a table, with one entry per function except for certain types of functions that do not need the pdata. The table is stored in a .pdata section.

The following table shows the function-table entry format used for the ARM, SH-3, and SH-4 platforms.

Offset Size Field Description
0 4 Begin Address Virtual address of the corresponding function.
4 8 bits Prolog Length Number of instructions in the function's prolog.
4 22 bits Function Length Number of instructions in the function.
4 1 bit 32-bit Flag Set if the function is comprised of 32-bit instructions, cleared for a 16-bit function.
4 1 bit Exception Flag Set if an exception handler exists for the function.

In the event that the ExceptionFlag member of the PDATA structure is set, or the FuncLen member is set to zero, an additional PDATA_EH structure precedes the function in the .text section. The function uses PDATA_EH for associated exception handling and handler data.

In most cases, PDATA structure occupies only eight bytes per function. For functions that have an exception handler, the PDATA_EH structure requires an additional eight bytes.

The exception-handling data record and the prolog and function length record are both guaranteed to be 4-byte aligned. This implies that any function that has either or both of these records associated with it is 4-byte aligned.

See Also

SH-4 Calling Sequence Specification | SH-4 Registers | SH-4 Stack Frame Layout | SH-4 Parameter Passing | SH-4 Return Values | SH-4 Prolog and Epilog | SH-4 Assembler Macros | _IMAGE_CE_RUNTIME_FUNCTION_ENTRY

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.