pcobj.h
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 437 行 · 第 1/2 页
H
437 行
CMD_LCOMDEF = 0xb8, /* local comdev */
CMD_STATIC_COMDEF = 0xb8,
CMD_CEXTDF = 0xbc, /* external reference to a COMDAT */
CMD_COMDAT = 0xc2, /* initialized communal data record */
CMD_COMDAT32 = 0xc3, /* initialized 32-bit communal data record */
CMD_COMD32 = 0xc3, /* initialized 32-bit communal data record */
CMD_LINSYM = 0xc4, /* LINNUM for a COMDAT */
CMD_LINSYM32 = 0xc5, /* 32-bit LINNUM for a COMDAT */
CMD_LINS32 = 0xc5, /* 32-bit LINNUM for a COMDAT */
CMD_ALIAS = 0xc6, /* alias definition record */
CMD_NBKPAT = 0xc8, /* named backpatch record (quick c?) */
CMD_NBKPAT32 = 0xc9, /* 32-bit named backpatch record */
CMD_NBKP32 = 0xc9, /* 32-bit named backpatch record */
CMD_LLNAME = 0xca, /* a "local" lnames */
CMD_LLNAMES = 0xca,
CMD_VERNUM = 0xcc, /* TIS version number record */
CMD_VENDEXT = 0xce, /* TIS vendor extension record */
CMD_MAX_CMD = 0xce /* maximum cmd enum */
}cmd_omf;
enum {
LOC_OFFSET_LO = 0, /* relocate lo byte of offset */
LOC_OFFSET = 1, /* relocate offset */
LOC_BASE = 2, /* relocate segment */
LOC_BASE_OFFSET = 3, /* relocate segment and offset */
LOC_OFFSET_HI = 4, /* relocate hi byte of offset */
LOC_MS_LINK_OFFSET = 5, /* like OFFSET but loader resolved */
LOC_OFFSET_32 = 5, /* relocate 32-bit offset */
LOC_BASE_OFFSET_32 = 6, /* relocate segment and 32-bit offset*/
LOC_MS_OFFSET_32 = 9, /* MS 32-bit offset */
LOC_MS_BASE_OFFSET_32= 11, /* MS 48-bit pointer */
LOC_MS_LINK_OFFSET_32= 13 /* like OFFSET_32 but loader resolved*/
};
typedef struct obj_record {
uint_8 command;
uint_16 length;
} obj_record;
typedef struct obj_name {
uint_8 len;
char name[ 1 ];
} obj_name;
/*
Comment Type
*/
enum {
CMT_TNP = 0x80, /* no purge bit */
CMT_TNL = 0x40, /* no list bit */
};
/*
Comment classes
*/
enum {
CMT_LANGUAGE_TRANS = 0x00, /* Language translator comment */
CMT_INTEL_COPYRIGHT = 0x01, /* INTEL Copyright record */
CMT_MS_PADDING = 0x01, /* Microsoft uses this for padding */
CMT_WAT_PROC_MODEL = 0x9b, /* Watcom processor & model info */
CMT_MS_DOS_VERSION = 0x9c, /* obsolete */
CMT_MS_PROC_MODEL = 0x9d, /* Microsoft processor & model info */
CMT_DOSSEG = 0x9e, /* DOSSEG directive */
CMT_DEFAULT_LIBRARY = 0x9f, /* Default library cmd */
CMT_DLL_ENTRY = 0xa0, /* MS extension (misleading name!) */
CMT_MS_OMF = 0xa1, /* Microsoft's brand of OMF flag */
CMT_MS_END_PASS_1 = 0xa2, /* MS end of linker pass 1 */
CMT_LIBMOD = 0xa3, /* Record specifying name of object */
CMT_EXESTR = 0xa4, /* Executable string */
CMT_INCERR = 0xa6, /* Incremental Compilation Error */
CMT_NOPAD = 0xa7, /* No segment padding */
CMT_WKEXT = 0xa8, /* Weak external record */
CMT_LZEXT = 0xa9, /* Lazy external record */
CMT_EASY_OMF = 0xaa, /* Easy OMF signature record */
CMT_DEPENDENCY = 0xe9, /* Borland dependency record */
CMT_DISASM_DIRECTIVE= 0xfd, /* Directive to disassemblers */
CMT_LINKER_DIRECTIVE= 0xfe, /* Linker directive */
CMT_COMPILER_OPTIONS= 0xff, /* Microsoft: incremental compiler opts */
CMT_SOURCE_NAME = 0xff /* name of the source file */
};
/*
* pack COMENT into two bytes so it can be written as a word
*/
#define CMT_NP( a ) ((CMT_##a<<8)|CMT_TNP)
/*
* Comment Class Subtype
*/
enum {
DLL_IMPDEF = 0x01, /* Subtype IMPDEF of OMF extension class */
DLL_EXPDEF = 0x02, /* Subtype EXPDEF of OMF extension class */
DLL_INCDEF = 0x03, /* Subtype INCDEF of OMF extension class */
DLL_PROTLIB = 0x04, /* Protected Memory Library (OMF extension) */
DLL_LNKDIR = 0x05, /* Subtype LNKDIR of OMF extension class */
};
#define EASY_OMF_SIGNATURE "80386"
/*
this is the data that is given in the object file to determine the
target processor.
*/
typedef struct {
char processor;
char mem_model;
char unknown;
char emulation;
} cpu_data;
/*
Linker directives (mostly WLINK directives)
*/
enum {
LDIR_SOURCE_LANGUAGE= 'D', /* dbg maj/min and source language */
LDIR_DEFAULT_LIBRARY= 'L', /* default library cmd */
LDIR_OPT_FAR_CALLS = 'O', /* optimize far calls/jmps for this seg */
LDIR_OPT_UNSAFE = 'U', /* far call optimization unsafe for fixup*/
LDIR_VF_TABLE_DEF = 'V', /* virtual function table lazy extdef */
LDIR_VF_PURE_DEF = 'P', /* as above for pure functions */
LDIR_VF_REFERENCE = 'R', /* virtual function reference */
LDIR_PACKDATA = '7', /* amount to pack far data */
LDIR_FLAT_ADDRS = 'F', /* debug addresses are flat */
LDIR_OBJ_TIMESTAMP = 'T' /* file timestamp of object in a library */
};
/*
Microsoft coment class A0 extensions
*/
enum {
MOMF_IMPDEF = 1,
MOMF_EXPDEF = 2,
MOMF_INCDEF = 3,
MOMF_PROT_LIB = 4,
MOMF_LNKDIR = 5,
MOMF_BIG_ENDIAN = 6
};
/*
Disasm directives
*/
enum {
/*
DDIR_SCAN_TABLE is used by the code generator to indicate data in a
code segment. i.e., scan tables generated for switch()s, floating point
constants and string constants. The 'S' is followed by a segment index,
then the start and end+1 offsets into the segment which are words in
regular object files, and longs in EasyOMF and Microsoft 386.
If the segment index is zero, then it is followed by a LNAME index which
identifies the COMDAT symbol that the scan table belongs to.
*/
DDIR_SCAN_TABLE_32 = 'S',
DDIR_SCAN_TABLE = 's'
};
/*
COMDEF types
*/
enum {
COMDEF_FAR = 0x61, /* FAR variable */
COMDEF_NEAR = 0x62, /* NEAR variable */
COMDEF_LEAF_SIZE = 0x80, /* bit set if size > 0x7f */
COMDEF_LEAF_2 = 0x81, /* 2 byte size field */
COMDEF_LEAF_3 = 0x84, /* 3 byte size field */
COMDEF_LEAF_4 = 0x88 /* 4 byte size field */
};
enum {
/*
COMDAT flags
*/
COMDAT_CONTINUE = 0x01, /* continuation of previous COMDAT */
COMDAT_ITERATED = 0x02, /* LIDATA form of COMDAT */
COMDAT_LOCAL = 0x04, /* COMDAT is local to this module */
/*
COMDAT allocation type
*/
COMDAT_ALLOC_MASK = 0x0f,
COMDAT_EXPLICIT = 0x00, /* in given segment */
COMDAT_FAR_CODE = 0x01, /* allocate CODE use16 segment */
COMDAT_FAR_DATA = 0x02, /* allocate DATA use16 segment */
COMDAT_CODE32 = 0x03, /* allocate CODE use32 segment */
COMDAT_DATA32 = 0x04, /* allocate DATA use32 segment */
/*
COMDAT selection criteria
*/
COMDAT_MATCH_MASK = 0xf0,
COMDAT_MATCH_NONE = 0x00, /* don't match anyone */
COMDAT_MATCH_ANY = 0x10, /* pick any instance */
COMDAT_MATCH_SAME = 0x20, /* must be same size */
COMDAT_MATCH_EXACT = 0x30, /* must be exact match */
/*
COMDAT alignment
*/
COMDAT_ALIGN_SEG = 0x00, /* align from SEGDEF */
COMDAT_ALIGN_BYTE = 0x01,
COMDAT_ALIGN_WORD = 0x02,
COMDAT_ALIGN_PARA = 0x03,
COMDAT_ALIGN_4K = 0x04,
COMDAT_ALIGN_DWORD = 0x05
};
/*
PharLap/EASY_OMF segment attribute byte
*/
enum {
EASY_USE32_FIELD = 0x04, /* USE32 bit */
EASY_PROTECT_FIELD = 0x03, /* protection field */
EASY_READ_ONLY = 0x00, /* read-only */
EASY_EXEC_ONLY = 0x01, /* exec-only */
EASY_EXEC_READ = 0x02, /* exec-read */
EASY_READ_WRITE = 0x03 /* read-write */
};
#pragma pack()
#define PCOBJ_H 1
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?