xref: /openbsd-src/gnu/usr.bin/binutils/gas/config/obj-vms.h (revision 007c2a4539b8b8aaa95c5e73e77620090abe113b)
12159047fSniklas /* VMS object file format
2c074d1c9Sdrahn    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000,
3c074d1c9Sdrahn    2002, 2003 Free Software Foundation, Inc.
42159047fSniklas 
52159047fSniklas This file is part of GAS, the GNU Assembler.
62159047fSniklas 
72159047fSniklas GAS is free software; you can redistribute it and/or modify
82159047fSniklas it under the terms of the GNU General Public License as
92159047fSniklas published by the Free Software Foundation; either version 2,
102159047fSniklas or (at your option) any later version.
112159047fSniklas 
122159047fSniklas GAS is distributed in the hope that it will be useful, but
132159047fSniklas WITHOUT ANY WARRANTY; without even the implied warranty of
142159047fSniklas MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
152159047fSniklas the GNU General Public License for more details.
162159047fSniklas 
17b305b0f1Sespie You should have received a copy of the GNU General Public License
18b305b0f1Sespie along with GAS; see the file COPYING.  If not, write to the Free
19b305b0f1Sespie Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20b305b0f1Sespie 02111-1307, USA.  */
212159047fSniklas 
222159047fSniklas /* Tag to validate a.out object file format processing */
232159047fSniklas #define OBJ_VMS 1
242159047fSniklas 
252159047fSniklas #include "targ-cpu.h"
262159047fSniklas 
274361b62eSniklas #define LONGWORD_ALIGNMENT	2
284361b62eSniklas 
292159047fSniklas /* This macro controls subsection alignment within a section.
302159047fSniklas  *
312159047fSniklas  * Under VAX/VMS, the linker (and PSECT specifications)
322159047fSniklas  * take care of correctly aligning the segments.
332159047fSniklas  * Doing the alignment here (on initialized data) can
342159047fSniklas  * mess up the calculation of global data PSECT sizes.
352159047fSniklas  */
36c074d1c9Sdrahn #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN)	\
374361b62eSniklas   (((SEG) == data_section) ? 0 : LONGWORD_ALIGNMENT)
382159047fSniklas 
392159047fSniklas /* This flag is used to remember whether we are in the const or the
402159047fSniklas    data section.  By and large they are identical, but we set a no-write
412159047fSniklas    bit for psects in the const section.  */
422159047fSniklas 
432159047fSniklas extern unsigned char const_flag;
442159047fSniklas 
452159047fSniklas /* This is overloaded onto const_flag, for convenience.  It's used to flag
462159047fSniklas    dummy labels like "gcc2_compiled."  which occur before the first .text
472159047fSniklas    or .data section directive.  */
482159047fSniklas 
492159047fSniklas #define IN_DEFAULT_SECTION 0x80
502159047fSniklas 
512159047fSniklas /* These are defined in obj-vms.c.  */
522159047fSniklas extern const short seg_N_TYPE[];
532159047fSniklas extern const segT N_TYPE_seg[];
542159047fSniklas 
552159047fSniklas #undef NO_RELOC
562159047fSniklas enum reloc_type
572159047fSniklas   {
582159047fSniklas     NO_RELOC, RELOC_32
592159047fSniklas   };
602159047fSniklas 
612159047fSniklas #define N_BADMAG(x)	(0)
622159047fSniklas #define N_TXTOFF(x)	( sizeof (struct exec) )
632159047fSniklas #define N_DATOFF(x)	( N_TXTOFF(x) + (x).a_text )
642159047fSniklas #define N_TROFF(x)	( N_DATOFF(x) + (x).a_data )
652159047fSniklas #define N_DROFF(x)	( N_TROFF(x) + (x).a_trsize )
662159047fSniklas #define N_SYMOFF(x)	( N_DROFF(x) + (x).a_drsize )
672159047fSniklas #define N_STROFF(x)	( N_SYMOFF(x) + (x).a_syms )
682159047fSniklas 
692159047fSniklas /* We use this copy of the exec header for VMS.  We do not actually use it, but
702159047fSniklas    what we actually do is let gas fill in the relevant slots, and when we get
712159047fSniklas    around to writing an obj file, we just pick out what we need.  */
722159047fSniklas 
732159047fSniklas struct exec
742159047fSniklas {
752159047fSniklas   unsigned long a_text;		/* length of text, in bytes */
762159047fSniklas   unsigned long a_data;		/* length of data, in bytes */
772159047fSniklas   unsigned long a_bss;		/* length of uninitialized data area for file, in bytes */
782159047fSniklas   unsigned long a_trsize;	/* length of relocation info for text, in bytes */
792159047fSniklas   unsigned long a_drsize;	/* length of relocation info for data, in bytes */
802159047fSniklas   unsigned long a_entry;	/* start address */
812159047fSniklas   unsigned long a_syms;		/* length of symbol table data in file, in bytes */
822159047fSniklas };
832159047fSniklas 
842159047fSniklas typedef struct
852159047fSniklas   {
862159047fSniklas     struct exec header;		/* a.out header */
872159047fSniklas     long string_table_size;	/* names + '\0' + sizeof (int) */
882159047fSniklas   }
892159047fSniklas object_headers;
902159047fSniklas 
912159047fSniklas /* A single entry in the symbol table
922159047fSniklas  * (this started as a clone of bout.h's nlist, but much was unneeded).
932159047fSniklas  */
942159047fSniklas struct nlist
952159047fSniklas   {
962159047fSniklas     char *n_name;
972159047fSniklas     unsigned char n_type;	/* See below				*/
982159047fSniklas     unsigned char n_other;	/* used for const_flag and "default section" */
992159047fSniklas     unsigned	: 16;		/* padding for alignment */
1002159047fSniklas     int n_desc;			/* source line number for N_SLINE stabs */
1012159047fSniklas   };
1022159047fSniklas 
1032159047fSniklas /* Legal values of n_type (see aout/stab.def for the majority of the codes).
1042159047fSniklas  */
1052159047fSniklas #define N_UNDF	0		/* Undefined symbol	*/
1062159047fSniklas #define N_ABS	2		/* Absolute symbol	*/
1072159047fSniklas #define N_TEXT	4		/* Text symbol		*/
1082159047fSniklas #define N_DATA	6		/* Data symbol		*/
1092159047fSniklas #define N_BSS	8		/* BSS symbol		*/
1102159047fSniklas #define N_FN	31		/* Filename symbol	*/
1112159047fSniklas 
1122159047fSniklas #define N_EXT	1		/* External symbol (OR'd in with one of above)	*/
1132159047fSniklas #define N_TYPE	036		/* Mask for all the type bits			*/
1142159047fSniklas 
1152159047fSniklas #define N_STAB	0340		/* Mask for all bits used for SDB entries 	*/
1162159047fSniklas 
1172159047fSniklas #include "aout/stab_gnu.h"
1182159047fSniklas 
1192159047fSniklas /* SYMBOL TABLE */
1202159047fSniklas /* Symbol table entry data type */
1212159047fSniklas 
1222159047fSniklas typedef struct nlist obj_symbol_type;	/* Symbol table entry */
1232159047fSniklas 
1242159047fSniklas /* Symbol table macros and constants */
1252159047fSniklas 
1262159047fSniklas #define OBJ_SYMFIELD_TYPE struct VMS_Symbol *
1272159047fSniklas 
1282159047fSniklas /*
1292159047fSniklas  *  Macros to extract information from a symbol table entry.
130*007c2a45Smiod  *  This syntactic indirection allows independence regarding a.out or coff.
1312159047fSniklas  *  The argument (s) of all these macros is a pointer to a symbol table entry.
1322159047fSniklas  */
1332159047fSniklas 
1342159047fSniklas /* True if the symbol is external */
1352159047fSniklas #define S_IS_EXTERNAL(s)	((s)->sy_symbol.n_type & N_EXT)
1362159047fSniklas 
1372159047fSniklas /* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
1382159047fSniklas #define S_IS_DEFINED(s)		(S_GET_TYPE(s) != N_UNDF)
1392159047fSniklas 
1404361b62eSniklas #define S_IS_COMMON(s)	(S_GET_TYPE(s) == N_UNDF && S_GET_VALUE(s) != 0)
1414361b62eSniklas 
142c074d1c9Sdrahn /* Return true for symbols that should not be reduced to section
143c074d1c9Sdrahn    symbols or eliminated from expressions, because they may be
144c074d1c9Sdrahn    overridden by the linker.  */
145c074d1c9Sdrahn #define S_FORCE_RELOC(s, strict) \
146c074d1c9Sdrahn   (!SEG_NORMAL (S_GET_SEGMENT (s)))
147c074d1c9Sdrahn 
1482159047fSniklas #define S_IS_REGISTER(s)	((s)->sy_symbol.n_type == N_REGISTER)
1492159047fSniklas 
1502159047fSniklas /* True if a debug special symbol entry */
1512159047fSniklas #define S_IS_DEBUG(s)		((s)->sy_symbol.n_type & N_STAB)
1522159047fSniklas /* True if a symbol is local symbol name */
1532159047fSniklas /* A symbol name whose name begin with ^A is a gas internal pseudo symbol
1542159047fSniklas    nameless symbols come from .stab directives.  */
1552159047fSniklas #define S_IS_LOCAL(s)		(S_GET_NAME(s) && \
1562159047fSniklas 				 !S_IS_DEBUG(s) && \
1574361b62eSniklas 				 (strchr(S_GET_NAME(s), '\001') != 0 || \
1584361b62eSniklas 				  strchr(S_GET_NAME(s), '\002') != 0 || \
1592159047fSniklas 				  (S_LOCAL_NAME(s) && !flag_keep_locals)))
1602159047fSniklas /* True if a symbol is not defined in this file */
1612159047fSniklas #define S_IS_EXTERN(s)		((s)->sy_symbol.n_type & N_EXT)
1622159047fSniklas /* True if the symbol has been generated because of a .stabd directive */
1632159047fSniklas #define S_IS_STABD(s)		(S_GET_NAME(s) == (char *)0)
1642159047fSniklas 
1652159047fSniklas /* Accessors */
1662159047fSniklas /* The name of the symbol */
1672159047fSniklas #define S_GET_NAME(s)		((s)->sy_symbol.n_name)
1682159047fSniklas /* The pointer to the string table */
1692159047fSniklas #define S_GET_OFFSET(s)		((s)->sy_name_offset)
1702159047fSniklas /* The raw type of the symbol */
1712159047fSniklas #define S_GET_RAW_TYPE(s)		((s)->sy_symbol.n_type)
1722159047fSniklas /* The type of the symbol */
1732159047fSniklas #define S_GET_TYPE(s)		((s)->sy_symbol.n_type & N_TYPE)
1742159047fSniklas /* The numeric value of the segment */
1752159047fSniklas #define S_GET_SEGMENT(s)	(N_TYPE_seg[S_GET_TYPE(s)])
1762159047fSniklas /* The n_other expression value */
1772159047fSniklas #define S_GET_OTHER(s)		((s)->sy_symbol.n_other)
1782159047fSniklas /* The n_desc expression value */
1792159047fSniklas #define S_GET_DESC(s)		((s)->sy_symbol.n_desc)
1802159047fSniklas 
1812159047fSniklas /* Modifiers */
1822159047fSniklas /* Assume that a symbol cannot be simultaneously in more than on segment */
1832159047fSniklas /* set segment */
1842159047fSniklas #define S_SET_SEGMENT(s,seg)	((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type|=SEGMENT_TO_SYMBOL_TYPE(seg))
1852159047fSniklas /* The symbol is external */
1862159047fSniklas #define S_SET_EXTERNAL(s)	((s)->sy_symbol.n_type |= N_EXT)
1872159047fSniklas /* The symbol is not external */
1882159047fSniklas #define S_CLEAR_EXTERNAL(s)	((s)->sy_symbol.n_type &= ~N_EXT)
1892159047fSniklas /* Set the name of the symbol */
1902159047fSniklas #define S_SET_NAME(s,v)		((s)->sy_symbol.n_name = (v))
1912159047fSniklas /* Set the offset in the string table */
1922159047fSniklas #define S_SET_OFFSET(s,v)	((s)->sy_name_offset = (v))
1932159047fSniklas /* Set the n_other expression value */
1942159047fSniklas #define S_SET_OTHER(s,v)	((s)->sy_symbol.n_other = (v))
1952159047fSniklas /* Set the n_desc expression value */
1962159047fSniklas #define S_SET_DESC(s,v)		((s)->sy_symbol.n_desc = (v))
1972159047fSniklas /* Set the n_type expression value */
1982159047fSniklas #define S_SET_TYPE(s,v)		((s)->sy_symbol.n_type = (v))
1992159047fSniklas 
2002159047fSniklas /* File header macro and type definition */
2012159047fSniklas 
2022159047fSniklas #define H_GET_TEXT_SIZE(h)		((h)->header.a_text)
2032159047fSniklas #define H_GET_DATA_SIZE(h)		((h)->header.a_data)
2042159047fSniklas #define H_GET_BSS_SIZE(h)		((h)->header.a_bss)
2052159047fSniklas 
2062159047fSniklas #define H_SET_TEXT_SIZE(h,v)		((h)->header.a_text = md_section_align(SEG_TEXT, (v)))
2072159047fSniklas #define H_SET_DATA_SIZE(h,v)		((h)->header.a_data = md_section_align(SEG_DATA, (v)))
2082159047fSniklas #define H_SET_BSS_SIZE(h,v)		((h)->header.a_bss = md_section_align(SEG_BSS, (v)))
2092159047fSniklas 
2102159047fSniklas #define H_SET_STRING_SIZE(h,v)		((h)->string_table_size = (v))
2112159047fSniklas #define H_SET_SYMBOL_TABLE_SIZE(h,v)	((h)->header.a_syms = (v) * \
2122159047fSniklas 					 sizeof (struct nlist))
2132159047fSniklas 
2142159047fSniklas /* line numbering stuff.  */
2152159047fSniklas #define OBJ_EMIT_LINENO(a, b, c)	{;}
2162159047fSniklas 
2172159047fSniklas #define obj_symbol_new_hook(s)	{;}
2182159047fSniklas 
2192159047fSniklas /* Force structure tags into scope so that their use in prototypes
220*007c2a45Smiod    will never be their first occurrence.  */
2212159047fSniklas struct fix;
2222159047fSniklas struct frag;
2232159047fSniklas 
2242159047fSniklas /* obj-vms routines visible to the rest of gas.  */
2252159047fSniklas 
2262159047fSniklas extern void tc_aout_fix_to_chars PARAMS ((char *,struct fix *,relax_addressT));
2272159047fSniklas 
228b305b0f1Sespie extern int vms_resolve_symbol_redef PARAMS ((symbolS *));
2292159047fSniklas #define RESOLVE_SYMBOL_REDEFINITION(X)	vms_resolve_symbol_redef(X)
2302159047fSniklas 
2312159047fSniklas /* Compiler-generated label "__vax_g_doubles" is used to augment .stabs.  */
232b305b0f1Sespie extern void vms_check_for_special_label PARAMS ((symbolS *));
233b305b0f1Sespie #define obj_frob_label(X) vms_check_for_special_label(X)
2342159047fSniklas 
2352159047fSniklas extern void vms_check_for_main PARAMS ((void));
2362159047fSniklas 
2372159047fSniklas extern void vms_write_object_file PARAMS ((unsigned,unsigned,unsigned,
2382159047fSniklas 					   struct frag *,struct frag *));
2392159047fSniklas 
2402159047fSniklas /* VMS executables are nothing like a.out, but the VMS port of gcc uses
2412159047fSniklas    a.out format stabs which obj-vms.c then translates.  */
2422159047fSniklas 
2432159047fSniklas #define AOUT_STABS
2442159047fSniklas 
2452159047fSniklas 
2462159047fSniklas #ifdef WANT_VMS_OBJ_DEFS
2472159047fSniklas 
2482159047fSniklas /* The rest of this file contains definitions for constants used within
2492159047fSniklas    the actual VMS object file.  We do not use a $ in the symbols (as per
2502159047fSniklas    usual VMS convention) since System V gags on it.  */
2512159047fSniklas 
2522159047fSniklas #define	OBJ_S_C_HDR	0
2532159047fSniklas #define	OBJ_S_C_HDR_MHD	0
2542159047fSniklas #define	OBJ_S_C_HDR_LNM	1
2552159047fSniklas #define	OBJ_S_C_HDR_SRC	2
2562159047fSniklas #define	OBJ_S_C_HDR_TTL	3
2572159047fSniklas #define	OBJ_S_C_HDR_CPR	4
2582159047fSniklas #define	OBJ_S_C_HDR_MTC	5
2592159047fSniklas #define	OBJ_S_C_HDR_GTX	6
2602159047fSniklas #define	OBJ_S_C_GSD	1
2612159047fSniklas #define	OBJ_S_C_GSD_PSC	0
2622159047fSniklas #define	OBJ_S_C_GSD_SYM	1
2632159047fSniklas #define	OBJ_S_C_GSD_EPM	2
2642159047fSniklas #define	OBJ_S_C_GSD_PRO	3
2652159047fSniklas #define	OBJ_S_C_GSD_SYMW	4
2662159047fSniklas #define	OBJ_S_C_GSD_EPMW	5
2672159047fSniklas #define	OBJ_S_C_GSD_PROW	6
2682159047fSniklas #define	OBJ_S_C_GSD_IDC	7
2692159047fSniklas #define	OBJ_S_C_GSD_ENV	8
2702159047fSniklas #define	OBJ_S_C_GSD_LSY	9
2712159047fSniklas #define	OBJ_S_C_GSD_LEPM	10
2722159047fSniklas #define	OBJ_S_C_GSD_LPRO	11
2732159047fSniklas #define	OBJ_S_C_GSD_SPSC	12
2742159047fSniklas #define	OBJ_S_C_TIR	2
2752159047fSniklas #define	OBJ_S_C_EOM	3
2762159047fSniklas #define	OBJ_S_C_DBG	4
2772159047fSniklas #define	OBJ_S_C_TBT	5
2782159047fSniklas #define	OBJ_S_C_LNK	6
2792159047fSniklas #define	OBJ_S_C_EOMW	7
2802159047fSniklas #define	OBJ_S_C_MAXRECTYP	7
2812159047fSniklas #define	OBJ_S_K_SUBTYP	1
2822159047fSniklas #define	OBJ_S_C_SUBTYP	1
2832159047fSniklas #define	OBJ_S_C_MAXRECSIZ	2048
2842159047fSniklas #define	OBJ_S_C_STRLVL	0
2852159047fSniklas #define	OBJ_S_C_SYMSIZ	31
2862159047fSniklas #define	OBJ_S_C_STOREPLIM	-1
2872159047fSniklas #define	OBJ_S_C_PSCALILIM	9
2882159047fSniklas 
2892159047fSniklas #define	MHD_S_C_MHD	0
2902159047fSniklas #define	MHD_S_C_LNM	1
2912159047fSniklas #define	MHD_S_C_SRC	2
2922159047fSniklas #define	MHD_S_C_TTL	3
2932159047fSniklas #define	MHD_S_C_CPR	4
2942159047fSniklas #define	MHD_S_C_MTC	5
2952159047fSniklas #define	MHD_S_C_GTX	6
2962159047fSniklas #define	MHD_S_C_MAXHDRTYP	6
2972159047fSniklas 
2982159047fSniklas #define	GSD_S_K_ENTRIES	1
2992159047fSniklas #define	GSD_S_C_ENTRIES	1
3002159047fSniklas #define	GSD_S_C_PSC	0
3012159047fSniklas #define	GSD_S_C_SYM	1
3022159047fSniklas #define	GSD_S_C_EPM	2
3032159047fSniklas #define	GSD_S_C_PRO	3
3042159047fSniklas #define	GSD_S_C_SYMW	4
3052159047fSniklas #define	GSD_S_C_EPMW	5
3062159047fSniklas #define	GSD_S_C_PROW	6
3072159047fSniklas #define	GSD_S_C_IDC	7
3082159047fSniklas #define	GSD_S_C_ENV	8
3092159047fSniklas #define	GSD_S_C_LSY	9
3102159047fSniklas #define	GSD_S_C_LEPM	10
3112159047fSniklas #define	GSD_S_C_LPRO	11
3122159047fSniklas #define	GSD_S_C_SPSC	12
3132159047fSniklas #define	GSD_S_C_SYMV	13
3142159047fSniklas #define	GSD_S_C_EPMV	14
3152159047fSniklas #define	GSD_S_C_PROV	15
3162159047fSniklas #define	GSD_S_C_MAXRECTYP	15
3172159047fSniklas 
3182159047fSniklas #define	GSY_S_M_WEAK	1
3192159047fSniklas #define	GSY_S_M_DEF	2
3202159047fSniklas #define	GSY_S_M_UNI	4
3212159047fSniklas #define	GSY_S_M_REL	8
3222159047fSniklas 
3232159047fSniklas #define	LSY_S_M_DEF	2
3242159047fSniklas #define	LSY_S_M_REL	8
3252159047fSniklas 
3262159047fSniklas #define	ENV_S_M_DEF	1
3272159047fSniklas #define	ENV_S_M_NESTED	2
3282159047fSniklas 
3292159047fSniklas #define	GPS_S_M_PIC	1
3302159047fSniklas #define	GPS_S_M_LIB	2
3312159047fSniklas #define	GPS_S_M_OVR	4
3322159047fSniklas #define	GPS_S_M_REL	8
3332159047fSniklas #define	GPS_S_M_GBL	16
3342159047fSniklas #define	GPS_S_M_SHR	32
3352159047fSniklas #define	GPS_S_M_EXE	64
3362159047fSniklas #define	GPS_S_M_RD	128
3372159047fSniklas #define	GPS_S_M_WRT	256
3382159047fSniklas #define	GPS_S_M_VEC	512
3392159047fSniklas #define	GPS_S_K_NAME	9
3402159047fSniklas #define	GPS_S_C_NAME	9
3412159047fSniklas 
3422159047fSniklas #define	TIR_S_C_STA_GBL	0
3432159047fSniklas #define	TIR_S_C_STA_SB	1
3442159047fSniklas #define	TIR_S_C_STA_SW	2
3452159047fSniklas #define	TIR_S_C_STA_LW	3
3462159047fSniklas #define	TIR_S_C_STA_PB	4
3472159047fSniklas #define	TIR_S_C_STA_PW	5
3482159047fSniklas #define	TIR_S_C_STA_PL	6
3492159047fSniklas #define	TIR_S_C_STA_UB	7
3502159047fSniklas #define	TIR_S_C_STA_UW	8
3512159047fSniklas #define	TIR_S_C_STA_BFI	9
3522159047fSniklas #define	TIR_S_C_STA_WFI	10
3532159047fSniklas #define	TIR_S_C_STA_LFI	11
3542159047fSniklas #define	TIR_S_C_STA_EPM	12
3552159047fSniklas #define	TIR_S_C_STA_CKARG	13
3562159047fSniklas #define	TIR_S_C_STA_WPB	14
3572159047fSniklas #define	TIR_S_C_STA_WPW	15
3582159047fSniklas #define	TIR_S_C_STA_WPL	16
3592159047fSniklas #define	TIR_S_C_STA_LSY	17
3602159047fSniklas #define	TIR_S_C_STA_LIT	18
3612159047fSniklas #define	TIR_S_C_STA_LEPM	19
3622159047fSniklas #define	TIR_S_C_MAXSTACOD	19
3632159047fSniklas #define	TIR_S_C_MINSTOCOD	20
3642159047fSniklas #define	TIR_S_C_STO_SB	20
3652159047fSniklas #define	TIR_S_C_STO_SW	21
3662159047fSniklas #define	TIR_S_C_STO_L	22
3672159047fSniklas #define	TIR_S_C_STO_BD	23
3682159047fSniklas #define	TIR_S_C_STO_WD	24
3692159047fSniklas #define	TIR_S_C_STO_LD	25
3702159047fSniklas #define	TIR_S_C_STO_LI	26
3712159047fSniklas #define	TIR_S_C_STO_PIDR	27
3722159047fSniklas #define	TIR_S_C_STO_PICR	28
3732159047fSniklas #define	TIR_S_C_STO_RSB	29
3742159047fSniklas #define	TIR_S_C_STO_RSW	30
3752159047fSniklas #define	TIR_S_C_STO_RL	31
3762159047fSniklas #define	TIR_S_C_STO_VPS	32
3772159047fSniklas #define	TIR_S_C_STO_USB	33
3782159047fSniklas #define	TIR_S_C_STO_USW	34
3792159047fSniklas #define	TIR_S_C_STO_RUB	35
3802159047fSniklas #define	TIR_S_C_STO_RUW	36
3812159047fSniklas #define	TIR_S_C_STO_B	37
3822159047fSniklas #define	TIR_S_C_STO_W	38
3832159047fSniklas #define	TIR_S_C_STO_RB	39
3842159047fSniklas #define	TIR_S_C_STO_RW	40
3852159047fSniklas #define	TIR_S_C_STO_RIVB	41
3862159047fSniklas #define	TIR_S_C_STO_PIRR	42
3872159047fSniklas #define	TIR_S_C_MAXSTOCOD	42
3882159047fSniklas #define	TIR_S_C_MINOPRCOD	50
3892159047fSniklas #define	TIR_S_C_OPR_NOP	50
3902159047fSniklas #define	TIR_S_C_OPR_ADD	51
3912159047fSniklas #define	TIR_S_C_OPR_SUB	52
3922159047fSniklas #define	TIR_S_C_OPR_MUL	53
3932159047fSniklas #define	TIR_S_C_OPR_DIV	54
3942159047fSniklas #define	TIR_S_C_OPR_AND	55
3952159047fSniklas #define	TIR_S_C_OPR_IOR	56
3962159047fSniklas #define	TIR_S_C_OPR_EOR	57
3972159047fSniklas #define	TIR_S_C_OPR_NEG	58
3982159047fSniklas #define	TIR_S_C_OPR_COM	59
3992159047fSniklas #define	TIR_S_C_OPR_INSV	60
4002159047fSniklas #define	TIR_S_C_OPR_ASH	61
4012159047fSniklas #define	TIR_S_C_OPR_USH	62
4022159047fSniklas #define	TIR_S_C_OPR_ROT	63
4032159047fSniklas #define	TIR_S_C_OPR_SEL	64
4042159047fSniklas #define	TIR_S_C_OPR_REDEF	65
4052159047fSniklas #define	TIR_S_C_OPR_DFLIT	66
4062159047fSniklas #define	TIR_S_C_MAXOPRCOD	66
4072159047fSniklas #define	TIR_S_C_MINCTLCOD	80
4082159047fSniklas #define	TIR_S_C_CTL_SETRB	80
4092159047fSniklas #define	TIR_S_C_CTL_AUGRB	81
4102159047fSniklas #define	TIR_S_C_CTL_DFLOC	82
4112159047fSniklas #define	TIR_S_C_CTL_STLOC	83
4122159047fSniklas #define	TIR_S_C_CTL_STKDL	84
4132159047fSniklas #define	TIR_S_C_MAXCTLCOD	84
4142159047fSniklas 
4152159047fSniklas /*
4162159047fSniklas  *	Debugger symbol definitions:  These are done by hand, as no
4172159047fSniklas  *					machine-readable version seems
4182159047fSniklas  *					to be available.
4192159047fSniklas  */
4202159047fSniklas #define DST_S_C_C	  7	/* Language == "C"	*/
4212159047fSniklas #define DST_S_C_CXX	 15	/* Language == "C++"	*/
4222159047fSniklas #define DST_S_C_VERSION	153
4232159047fSniklas #define	DST_S_C_SOURCE	155	/* Source file		*/
4242159047fSniklas #define DST_S_C_PROLOG	162
4252159047fSniklas #define	DST_S_C_BLKBEG	176	/* Beginning of block	*/
4262159047fSniklas #define	DST_S_C_BLKEND	177	/* End of block	*/
4272159047fSniklas #define DST_S_C_ENTRY	181
4282159047fSniklas #define DST_S_C_PSECT	184
4292159047fSniklas #define	DST_S_C_LINE_NUM	185	/* Line Number		*/
4302159047fSniklas #define DST_S_C_LBLORLIT	186
4312159047fSniklas #define DST_S_C_LABEL	187
4322159047fSniklas #define	DST_S_C_MODBEG	188	/* Beginning of module	*/
4332159047fSniklas #define	DST_S_C_MODEND	189	/* End of module	*/
4342159047fSniklas #define	DST_S_C_RTNBEG	190	/* Beginning of routine	*/
4352159047fSniklas #define	DST_S_C_RTNEND	191	/* End of routine	*/
4362159047fSniklas #define	DST_S_C_DELTA_PC_W	1	/* Incr PC	*/
4372159047fSniklas #define	DST_S_C_INCR_LINUM	2	/* Incr Line #	*/
4382159047fSniklas #define	DST_S_C_INCR_LINUM_W	3	/* Incr Line #	*/
4392159047fSniklas #define DST_S_C_SET_LINUM_INCR	4
4402159047fSniklas #define DST_S_C_SET_LINUM_INCR_W	5
4412159047fSniklas #define DST_S_C_RESET_LINUM_INCR	6
4422159047fSniklas #define DST_S_C_BEG_STMT_MODE	7
4432159047fSniklas #define DST_S_C_END_STMT_MODE	8
4442159047fSniklas #define	DST_S_C_SET_LINE_NUM	9	/* Set Line #	*/
4452159047fSniklas #define DST_S_C_SET_PC		10
4462159047fSniklas #define DST_S_C_SET_PC_W		11
4472159047fSniklas #define DST_S_C_SET_PC_L		12
4482159047fSniklas #define DST_S_C_SET_STMTNUM	13
4492159047fSniklas #define DST_S_C_TERM		14	/* End of lines	*/
4502159047fSniklas #define DST_S_C_TERM_W		15	/* End of lines	*/
4512159047fSniklas #define	DST_S_C_SET_ABS_PC	16	/* Set PC	*/
4522159047fSniklas #define	DST_S_C_DELTA_PC_L	17	/* Incr PC	*/
4532159047fSniklas #define DST_S_C_INCR_LINUM_L	18	/* Incr Line #	*/
4542159047fSniklas #define DST_S_C_SET_LINUM_B	19	/* Set Line #	*/
4552159047fSniklas #define DST_S_C_SET_LINUM_L	20	/* Set Line #	*/
4562159047fSniklas #define	DST_S_C_TERM_L		21	/* End of lines	*/
4572159047fSniklas /* these are used with DST_S_C_SOURCE */
4582159047fSniklas #define DST_S_C_SRC_DECLFILE	 1	/* Declare source file */
4592159047fSniklas #define DST_S_C_SRC_SETFILE	 2	/* Set source file */
4602159047fSniklas #define DST_S_C_SRC_SETREC_L	 3	/* Set record, longword value */
4612159047fSniklas #define DST_S_C_SRC_SETREC_W	 4	/* Set record, word value */
4622159047fSniklas #define DST_S_C_SRC_DEFLINES_W	10	/* # of line, word counter */
4632159047fSniklas #define DST_S_C_SRC_DEFLINES_B	11	/* # of line, byte counter */
4642159047fSniklas #define DST_S_C_SRC_FORMFEED	16	/* ^L counts as a record */
4652159047fSniklas /* the following are the codes for the various data types.  Anything not on
4662159047fSniklas  * the list is included under 'advanced_type'
4672159047fSniklas  */
4682159047fSniklas #define DBG_S_C_UCHAR		0x02
4692159047fSniklas #define DBG_S_C_USINT		0x03
4702159047fSniklas #define DBG_S_C_ULINT		0x04
4712159047fSniklas #define DBG_S_C_UQUAD		0x05
4722159047fSniklas #define DBG_S_C_SCHAR		0x06
4732159047fSniklas #define DBG_S_C_SSINT		0x07
4742159047fSniklas #define DBG_S_C_SLINT		0x08
4752159047fSniklas #define DBG_S_C_SQUAD		0x09
4762159047fSniklas #define DBG_S_C_REAL4		0x0a
4772159047fSniklas #define DBG_S_C_REAL8		0x0b		/* D_float double */
4782159047fSniklas #define DBG_S_C_COMPLX4		0x0c		/* 2xF_float complex float */
4792159047fSniklas #define DBG_S_C_COMPLX8		0x0d		/* 2xD_float complex double */
4802159047fSniklas #define DBG_S_C_REAL8_G		0x1b		/* G_float double */
4812159047fSniklas #define DBG_S_C_COMPLX8_G	0x1d		/* 2xG_float complex double */
4822159047fSniklas #define DBG_S_C_FUNCTION_ADDR	0x17
4832159047fSniklas #define DBG_S_C_ADVANCED_TYPE	0xa3
4842159047fSniklas /*  Some of these are just for future reference.  [pr]
4852159047fSniklas  */
4862159047fSniklas #define DBG_S_C_UBITA		0x01	/* unsigned, aligned bit field */
4872159047fSniklas #define DBG_S_C_UBITU		0x22	/* unsigned, unaligned bit field */
4882159047fSniklas #define DBG_S_C_SBITA		0x29	/* signed, aligned bit field */
4892159047fSniklas #define DBG_S_C_SBITU		0x2a	/* signed, unaligned bit field */
4902159047fSniklas #define DBG_S_C_CSTRING		0x2e	/* asciz ('\0' terminated) string */
4912159047fSniklas #define DBG_S_C_WCHAR		0x38	/* wchar_t */
4922159047fSniklas /*  These are descriptor class codes.
4932159047fSniklas  */
4942159047fSniklas #define DSC_K_CLASS_S		0x01	/* static (fixed length) */
4952159047fSniklas #define DSC_K_CLASS_D		0x02	/* dynamic string (not via malloc!) */
4962159047fSniklas #define DSC_K_CLASS_A		0x04	/* array */
4972159047fSniklas #define DSC_K_CLASS_UBS		0x0d	/* unaligned bit string */
4982159047fSniklas /*  These are the codes that are used to generate the definitions of struct
4992159047fSniklas  *  union and enum records
5002159047fSniklas  */
5012159047fSniklas #define DBG_S_C_ENUM_ITEM		0xa4
5022159047fSniklas #define DBG_S_C_ENUM_START		0xa5
5032159047fSniklas #define DBG_S_C_ENUM_END		0xa6
5042159047fSniklas #define DBG_S_C_STRUCT_ITEM		DST_K_VFLAGS_BITOFFS	/* 0xff */
5052159047fSniklas #define DBG_S_C_STRUCT_START		0xab
5062159047fSniklas #define DBG_S_C_STRUCT_END		0xac
5072159047fSniklas #define DST_K_TYPSPEC			0xaf		/* type specification */
5082159047fSniklas /* These codes are used in the generation of the symbol definition records
5092159047fSniklas  */
5102159047fSniklas #define DST_K_VFLAGS_NOVAL		0x80	/* struct definition only */
5112159047fSniklas #define DST_K_VFLAGS_DSC		0xfa	/* descriptor used */
5122159047fSniklas #define DST_K_VFLAGS_TVS		0xfb	/* trailing value specified */
5132159047fSniklas #define DST_K_VS_FOLLOWS		0xfd	/* value spec follows */
5142159047fSniklas #define DST_K_VFLAGS_BITOFFS		0xff	/* value contains bit offset */
5152159047fSniklas #define DST_K_VALKIND_LITERAL	0
5162159047fSniklas #define DST_K_VALKIND_ADDR	1
5172159047fSniklas #define DST_K_VALKIND_DESC	2
5182159047fSniklas #define DST_K_VALKIND_REG	3
5192159047fSniklas #define DST_K_REG_VAX_AP	0x0c	/* R12 */
5202159047fSniklas #define DST_K_REG_VAX_FP	0x0d	/* R13 */
5212159047fSniklas #define DST_K_REG_VAX_SP	0x0e	/* R14 */
5222159047fSniklas #define DST_V_VALKIND		0	/* offset of valkind field */
5232159047fSniklas #define DST_V_INDIRECT		2	/* offset to indirect bit */
5242159047fSniklas #define DST_V_DISP		3	/* offset to displacement bit */
5252159047fSniklas #define DST_V_REGNUM		4	/* offset to register number */
5262159047fSniklas #define DST_M_INDIRECT		(1<<DST_V_INDIRECT)
5272159047fSniklas #define DST_M_DISP		(1<<DST_V_DISP)
5282159047fSniklas #define DBG_C_FUNCTION_PARAM	/* 0xc9 */	\
5292159047fSniklas 	(DST_K_VALKIND_ADDR|DST_M_DISP|(DST_K_REG_VAX_AP<<DST_V_REGNUM))
5302159047fSniklas #define DBG_C_LOCAL_SYM		/* 0xd9 */	\
5312159047fSniklas 	(DST_K_VALKIND_ADDR|DST_M_DISP|(DST_K_REG_VAX_FP<<DST_V_REGNUM))
5322159047fSniklas /* Kinds of value specifications
5332159047fSniklas  */
5342159047fSniklas #define DST_K_VS_ALLOC_SPLIT	3	/* split lifetime */
5352159047fSniklas /* Kinds of type specifications
5362159047fSniklas  */
5372159047fSniklas #define DST_K_TS_ATOM		0x01	/* atomic type specification */
5382159047fSniklas #define DST_K_TS_DSC		0x02	/* descriptor type spec */
5392159047fSniklas #define DST_K_TS_IND		0x03	/* indirect type specification */
5402159047fSniklas #define DST_K_TS_TPTR		0x04	/* typed pointer type spec */
5412159047fSniklas #define DST_K_TS_PTR		0x05	/* pointer type spec */
5422159047fSniklas #define DST_K_TS_ARRAY		0x07	/* array type spec */
5432159047fSniklas #define DST_K_TS_NOV_LENG	0x0e	/* novel length type spec */
5442159047fSniklas /*  These are the codes that are used in the suffix records to determine the
5452159047fSniklas  *  actual data type
5462159047fSniklas  */
5472159047fSniklas #define DBG_S_C_BASIC			DST_K_TS_ATOM
5482159047fSniklas #define DBG_S_C_BASIC_ARRAY		DST_K_TS_DSC
5492159047fSniklas #define DBG_S_C_STRUCT			DST_K_TS_IND
5502159047fSniklas #define DBG_S_C_POINTER			DST_K_TS_TPTR
5512159047fSniklas #define DBG_S_C_VOID			DST_K_TS_PTR
5522159047fSniklas #define DBG_S_C_COMPLEX_ARRAY		DST_K_TS_ARRAY
5532159047fSniklas 
5542159047fSniklas #endif	/* WANT_VMS_OBJ_DEFS */
555