pcobj.h

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 437 行 · 第 1/2 页

H
437
字号
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#ifndef PCOBJ_H
#include <watcom.h>

#pragma pack(1)
/*
 * Library stuff
 */
typedef struct hash_entry {
    uint_16     minor_class;
    uint_16     minor_inc;
    uint_16     major_class;
    uint_16     major_inc;
} hash_entry;

typedef struct lib_header {
    uint_8      cmd;
    uint_16     length;
    uint_32     dict_start;
    uint_16     dict_size;
} lib_header;

enum {
    LIB_FULL_PAGE       = 0xff,
    LIB_NOT_FOUND       = 0,
    LIB_HEADER_REC      = 0xf0,
    LIB_TRAILER_REC     = 0xf1
};

enum {
    DIC_REC_SIZE        = 512U,     /* record size of dictionary entry */
    IS_2_BYTES          = 0x80      /* bit set indicating 2 byte value */
};

/*
 *  INTEL Segment Alignment Specifiers - A field
 */
 enum {
    ALIGN_ABS           = 0,        /* absolute segment - no alignment  */
    ALIGN_BYTE          = 1,        /* relocatable seg - byte aligned   */
    ALIGN_WORD          = 2,        /* relocatable seg - word aligned   */
    ALIGN_PARA          = 3,        /* relocatable seg - para aligned   */
    ALIGN_PAGE          = 4,        /* relocatable seg - page aligned   */
    ALIGN_DWORD         = 5,        /* relocatable seg - dword aligned  */
    ALIGN_LTRELOC       = 6,        /* load-time relocatable segment    */
   /* this encountered in 386 object files only. */
    ALIGN_4KPAGE        = 6,        /* relocatable seg - 4k page aligned*/
    ALIGN_PAGE4K        = 6,        /* relocatable seg - 4k page aligned*/
   /* this currently not supported by the linker. */
    ALIGN_UNABS         = 5,        /* unnamed absolute segment         */
};

/*
 *  INTEL Segment Combination Attributes - C field
 */

enum {
    COMB_INVALID        = 0,
    COMB_ABOVEALL       = 1,
    COMB_ADDOFF         = 2,
    COMB_BAD            = 3,
    COMB_FOUR           = 4,
    COMB_STACK          = 5,
    COMB_COMMON         = 6,
    COMB_ALIGNTOP       = 7,
};
#define SEGATTR_A( a )  (ALIGN_##a << 5)
#define SEGATTR_C( a )  (COMB_##a << 2)
enum {
      SEGATTR_BIG  =   1<< 1,   // exactly 64k or 2**32
      SEGATTR_P    =   1,       // use 32
};
/*  Bits in FIXUPP records          TAI */

enum {
    FIXUPP_FIXUP        = 0x80,

    FIXDAT_FTHREAD      = 0x80,
    FIXDAT_TTHREAD      = 8,
    FIXDAT_PBIT         = 4,
    FIXDAT_MBIT         = 0x40,
    TRDDAT_DBIT         = 0x40,

/*
 *  INTEL Frame Specifiers
 */

    FRAME_SEG           = 0,        /* segment index                    */
    FRAME_GRP           = 1,        /* group index                      */
    FRAME_EXT           = 2,        /* external index                   */
    FRAME_ABS           = 3,        /* absolute frame number            */
    FRAME_LOC           = 4,        /* frame containing location        */
    FRAME_TARG          = 5,        /* frame same as target             */
    FRAME_NONE          = 6,        /* no frame                         */

/*
 *  INTEL Target Specifiers
 */

    TARGET_SEGWD        = 0,        /* segment index with displacement  */
    TARGET_GRPWD        = 1,        /* group index with displacement    */
    TARGET_EXTWD        = 2,        /* external index with displacement */
    TARGET_ABSWD        = 3,        /* abs frame num with displacement  */
    TARGET_SEG          = 4,        /* segment index, no displacement   */
    TARGET_GRP          = 5,        /* group index, no displacement     */
    TARGET_EXT          = 6,        /* external index, no displacement  */
    TARGET_ABS          = 7,        /* abs frame num, no displacement   */

    TARGET_WITH_DISPL   = ~4,       /* frame with displacement          */

/*
 *  INTEL Group Specifiers
 */

    GRP_SEGIDX          = 0xff,     /* group segment index              */
    GRP_EXTIDX          = 0xfe,     /* group external index             */
    GRP_FULLNAME        = 0xfd,     /* full name indices                */
    GRP_LTLDATA         = 0xfb,     /* load time data info              */
    GRP_ADDR            = 0xfa,     /* load time addr for the group     */
};

/*
 *  INTEL Object Record Types
 */

typedef enum {
    CMD_MIN_CMD         = 0x6e,     /* minimum cmd enum                 */
    CMD_RHEADR          = 0x6e,
    CMD_REGINT          = 0x70,
    CMD_REDATA          = 0x72,
    CMD_RIDATA          = 0x74,
    CMD_OVLDEF          = 0x76,
    CMD_ENDREC          = 0x78,
    CMD_BLKDEF          = 0x7a,     /* block definition record          */
    CMD_BLKDEF32        = 0x7b,     /* weird extension for QNX MAX assembler */
    CMD_BLKD32          = 0x7b,     /* weird extension for QNX MAX assembler */
    CMD_BLKEND          = 0x7c,     /* block end record                 */
    CMD_BLKEND32        = 0x7d,     /* _might_ be used by QNX MAX assembler */
    CMD_BLKE32          = 0x7d,     /* _might_ be used by QNX MAX assembler */
    CMD_DEBSYM          = 0x7e,
    CMD_THEADR          = 0x80,     /* header record                    */
    CMD_LHEADR          = 0x82,
    CMD_PEDATA          = 0x84,
    CMD_PIDATA          = 0x86,
    CMD_COMENT          = 0x88,     /* comment record                   */
    CMD_MODEND          = 0x8a,     /* end of module record             */
    CMD_MODEND32        = 0x8b,     /* 32-bit end of module record      */
    CMD_MODE32          = 0x8b,     /* 32-bit end of module record      */
    CMD_EXTDEF          = 0x8c,     /* import names record              */
    CMD_TYPDEF          = 0x8e,     /* type definition record           */
    CMD_PUBDEF          = 0x90,     /* export names record              */
    CMD_PUBDEF32        = 0x91,     /* 32-bit export names record       */
    CMD_PUBD32          = 0x91,     /* 32-bit export names record       */
    CMD_LOCSYM          = 0x92,
    CMD_LINNUM          = 0x94,     /* line number record               */
    CMD_LINNUM32        = 0x95,     /* 32-bit line number record.       */
    CMD_LINN32          = 0x95,     /* 32-bit line number record.       */
    CMD_LNAMES          = 0x96,     /* list of names record             */
    CMD_SEGDEF          = 0x98,     /* segment definition record        */
    CMD_SEGDEF32        = 0x99,     /* 32-bit segment definition        */
    CMD_SEGD32          = 0x99,     /* 32-bit segment definition        */
    CMD_GRPDEF          = 0x9a,     /* group definition record          */
    CMD_FIXUP           = 0x9c,     /* relocation record                */
    CMD_FIXUPP          = 0x9c,     /* for those who stuttttttter       */
    CMD_FIXUPP32        = 0x9d,     /* 32-bit relocation record         */
    CMD_FIXU32          = 0x9d,     /* 32-bit relocation record         */
    CMD_LEDATA          = 0xa0,     /* object record                    */
    CMD_LEDATA32        = 0xa1,     /* 32-bit object record             */
    CMD_LEDA32          = 0xa1,     /* 32-bit object record             */
    CMD_LIDATA          = 0xa2,     /* repeated data record             */
    CMD_LIDATA32        = 0xa3,     /* 32-bit repeated data record      */
    CMD_LIDA32          = 0xa3,     /* 32-bit repeated data record      */
    CMD_LIBHED          = 0xa4,
    CMD_LIBNAM          = 0xa6,
    CMD_LIBLOC          = 0xa8,
    CMD_LIBDIC          = 0xaa,
    CMD_COMDEF          = 0xb0,     /* communal definition              */
    CMD_BAKPAT          = 0xb2,     /* backpatch record (for Quick C) */
    CMD_BAKPAT32        = 0xb3,
    CMD_BAKP32          = 0xb3,
    CMD_LEXTDEF         = 0xb4,     /*  local import names record */
    CMD_STATIC_EXTDEF   = 0xb4,
    CMD_LEXTDEF32       = 0xb5,     /*  32-bit local import names record */
    CMD_STATIC_EXTD32   = 0xb5,
    CMD_LPUBDEF         = 0xb6,     /* static export names record */
    CMD_STATIC_PUBDEF   = 0xb6,
    CMD_LPUBDEF32       = 0xb7,     /* static export names record */
    CMD_STATIC_PUBD32   = 0xb7,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?