From fd63344e356da161ac6262f865066e35fe2cd876 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 31 Mar 2010 07:35:54 +0000 Subject: [PATCH] 2010-03-31 Tristan Gingold * dcx.h: New file. * dsc.h: New file. * esdfm.h: New file. * esdfv.h: New file. * internal.h: New file. * lbr.h: New file. * prt.h: New file. * shl.h (struct vms_shl): Add comments. * esrf.h (ESRF__B_NAMLNG): New macro. * esdf.h (ESDF__B_NAMLNG): New macro. * emh.h: Add macros for fields maximum value. * eisd.h (EISD__M_PROTECT): Fix typo in comment. Add macros for offsets, version, section type and match control. Merge vms_eisd_ext into vms_eisd. * eihvn.h (EIHVN__MULTI_PROCESSING_BIT, EIHVN__GALAXY_BIT): Added. * eihs.h: Remove blank line. * eihd.h (struct vms_eihd): Add comments, add image subtype names. * eiha.h (struct vms_eiha): Add inishr and inishr_h fields. * eiaf.h (struct vms_eiaf): Fix base_va size. * egsy.h: Add comments. * egsd.h: Remove blank line. * egps.h: Add flag names. * eeom.h (EEOM__M_WKTFR): Added. * dst.h (DST__K_CXX): Added, and reident languages. (DST__K_SRC_INCRLNUM_B): Added. Indent and order pcline commands. Add record begin/end, enumerations, type specification, value specification, label, discontinue range definitions. --- include/vms/ChangeLog | 31 +++++ include/vms/dcx.h | 50 ++++++++ include/vms/dsc.h | 129 +++++++++++++++++++++ include/vms/dst.h | 135 +++++++++++++++++++--- include/vms/eeom.h | 2 + include/vms/egps.h | 14 +++ include/vms/egsd.h | 1 - include/vms/egsy.h | 16 +-- include/vms/eiaf.h | 2 +- include/vms/eiha.h | 4 + include/vms/eihd.h | 15 ++- include/vms/eihs.h | 1 - include/vms/eihvn.h | 2 + include/vms/eisd.h | 35 +++++- include/vms/emh.h | 7 ++ include/vms/esdf.h | 2 + include/vms/esdfm.h | 49 ++++++++ include/vms/esdfv.h | 49 ++++++++ include/vms/esrf.h | 2 + include/vms/internal.h | 63 ++++++++++ include/vms/lbr.h | 255 +++++++++++++++++++++++++++++++++++++++++ include/vms/prt.h | 43 +++++++ include/vms/shl.h | 6 +- 23 files changed, 877 insertions(+), 36 deletions(-) create mode 100644 include/vms/dcx.h create mode 100644 include/vms/dsc.h create mode 100644 include/vms/esdfm.h create mode 100644 include/vms/esdfv.h create mode 100644 include/vms/internal.h create mode 100644 include/vms/lbr.h create mode 100644 include/vms/prt.h diff --git a/include/vms/ChangeLog b/include/vms/ChangeLog index 19ad1d3835e..e6945f3030e 100644 --- a/include/vms/ChangeLog +++ b/include/vms/ChangeLog @@ -1,3 +1,34 @@ +2010-03-31 Tristan Gingold + + * dcx.h: New file. + * dsc.h: New file. + * esdfm.h: New file. + * esdfv.h: New file. + * internal.h: New file. + * lbr.h: New file. + * prt.h: New file. + * shl.h (struct vms_shl): Add comments. + * esrf.h (ESRF__B_NAMLNG): New macro. + * esdf.h (ESDF__B_NAMLNG): New macro. + * emh.h: Add macros for fields maximum value. + * eisd.h (EISD__M_PROTECT): Fix typo in comment. + Add macros for offsets, version, section type and match control. + Merge vms_eisd_ext into vms_eisd. + * eihvn.h (EIHVN__MULTI_PROCESSING_BIT, EIHVN__GALAXY_BIT): Added. + * eihs.h: Remove blank line. + * eihd.h (struct vms_eihd): Add comments, add image subtype names. + * eiha.h (struct vms_eiha): Add inishr and inishr_h fields. + * eiaf.h (struct vms_eiaf): Fix base_va size. + * egsy.h: Add comments. + * egsd.h: Remove blank line. + * egps.h: Add flag names. + * eeom.h (EEOM__M_WKTFR): Added. + * dst.h (DST__K_CXX): Added, and reident languages. + (DST__K_SRC_INCRLNUM_B): Added. + Indent and order pcline commands. + Add record begin/end, enumerations, type specification, value + specification, label, discontinue range definitions. + 2010-02-17 Tristan Gingold * dmt.h, dst.h, eeom.h, egps.h, egsd.h, egst.h, egsy.h: New Files. diff --git a/include/vms/dcx.h b/include/vms/dcx.h new file mode 100644 index 00000000000..b6f373ab5d3 --- /dev/null +++ b/include/vms/dcx.h @@ -0,0 +1,50 @@ +/* Alpha VMS external format for DeCompression. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_DCX_H +#define _VMS_DCX_H + +struct vms_dcxmap +{ + unsigned char size[4]; + unsigned char version[2]; + + unsigned char pad[2]; + unsigned char sanity[4]; + unsigned char flags[4]; + unsigned char nsubs[2]; + unsigned char sub0[2]; +}; + +struct vms_dcxsbm +{ + unsigned char size[2]; + unsigned char min_char; + unsigned char max_char; + unsigned char escape; + unsigned char flags_bits; + unsigned char flags[2]; + unsigned char nodes[2]; + unsigned char next[2]; +}; + +#endif /* _VMS_DCX_H */ diff --git a/include/vms/dsc.h b/include/vms/dsc.h new file mode 100644 index 00000000000..5a1b0e238a8 --- /dev/null +++ b/include/vms/dsc.h @@ -0,0 +1,129 @@ +/* Alpha VMS external format of Descriptors. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_DSC_H +#define _VMS_DSC_H + +/* Descriptors. */ +#define DSC__K_DTYPE_Z 0 /* Unspecified. */ +#define DSC__K_DTYPE_V 1 /* Bit. */ +#define DSC__K_DTYPE_BU 2 /* Byte logical. */ +#define DSC__K_DTYPE_WU 3 /* Word logical. */ +#define DSC__K_DTYPE_LU 4 /* Longword logical. */ +#define DSC__K_DTYPE_QU 5 /* Quadword logical. */ +#define DSC__K_DTYPE_B 6 /* Byte integer. */ +#define DSC__K_DTYPE_W 7 /* Word integer. */ +#define DSC__K_DTYPE_L 8 /* Longword integer. */ +#define DSC__K_DTYPE_Q 9 /* Quadword integer. */ +#define DSC__K_DTYPE_F 10 /* Single-precision floating. */ +#define DSC__K_DTYPE_D 11 /* Double-precision floating. */ +#define DSC__K_DTYPE_FC 12 /* Complex. */ +#define DSC__K_DTYPE_DC 13 /* Double-precision Complex. */ +#define DSC__K_DTYPE_T 14 /* ASCII text string. */ +#define DSC__K_DTYPE_NU 15 /* Numeric string, unsigned. */ +#define DSC__K_DTYPE_NL 16 /* Numeric string, left separate sign. */ +#define DSC__K_DTYPE_NLO 17 /* Numeric string, left overpunched sign. */ +#define DSC__K_DTYPE_NR 18 /* Numeric string, right separate sign. */ +#define DSC__K_DTYPE_NRO 19 /* Numeric string, right overpunched sign. */ +#define DSC__K_DTYPE_NZ 20 /* Numeric string, zoned sign. */ +#define DSC__K_DTYPE_P 21 /* Packed decimal string. */ +#define DSC__K_DTYPE_ZI 22 /* Sequence of instructions. */ +#define DSC__K_DTYPE_ZEM 23 /* Procedure entry mask. */ +#define DSC__K_DTYPE_DSC 24 /* Descriptor, used for arrays of dyn strings. */ +#define DSC__K_DTYPE_OU 25 /* Octaword logical. */ +#define DSC__K_DTYPE_O 26 /* Octaword integer. */ +#define DSC__K_DTYPE_G 27 /* Double precision G floating, 64 bit. */ +#define DSC__K_DTYPE_H 28 /* Quadruple precision floating, 128 bit. */ +#define DSC__K_DTYPE_GC 29 /* Double precision complex, G floating. */ +#define DSC__K_DTYPE_HC 30 /* Quadruple precision complex, H floating. */ +#define DSC__K_DTYPE_CIT 31 /* COBOL intermediate temporary. */ +#define DSC__K_DTYPE_BPV 32 /* Bound Procedure Value. */ +#define DSC__K_DTYPE_BLV 33 /* Bound Label Value. */ +#define DSC__K_DTYPE_VU 34 /* Bit Unaligned. */ +#define DSC__K_DTYPE_ADT 35 /* Absolute Date-Time. */ +#define DSC__K_DTYPE_VT 37 /* Varying Text. */ +#define DSC__K_DTYPE_T2 38 /* 16-bit char. */ +#define DSC__K_DTYPE_VT2 39 /* 16-bit varying char. */ + +#define DSC__K_CLASS_S 1 /* Fixed-length scalar/string. */ +#define DSC__K_CLASS_D 2 /* Dynamic string. */ +#define DSC__K_CLASS_V 3 /* Reserved. */ +#define DSC__K_CLASS_A 4 /* Contiguous array. */ +#define DSC__K_CLASS_P 5 /* Procedure argument descriptor. */ +#define DSC__K_CLASS_PI 6 /* Procedure incarnation descriptor. */ +#define DSC__K_CLASS_J 7 /* Reserved. */ +#define DSC__K_CLASS_JI 8 /* Obsolete. */ +#define DSC__K_CLASS_SD 9 /* Decimal (scalar) string. */ +#define DSC__K_CLASS_NCA 10 /* Non-contiguous array. */ +#define DSC__K_CLASS_VS 11 /* Varying string. */ +#define DSC__K_CLASS_VSA 12 /* Varying string array. */ +#define DSC__K_CLASS_UBS 13 /* Unaligned bit string. */ +#define DSC__K_CLASS_UBA 14 /* Unaligned bit array. */ +#define DSC__K_CLASS_SB 15 /* String with bounds. */ +#define DSC__K_CLASS_UBSB 16 /* Unaligned bit string with bounds. */ + +/* Common part. */ + +struct vms_dsc +{ + unsigned char length[2]; + unsigned char dtype; + unsigned char bclass; + unsigned char pointer[4]; +}; + +struct vms_dsc64 +{ + unsigned char mbo[2]; + unsigned char dtype; + unsigned char bclass; + unsigned char mbmo[4]; + unsigned char length[8]; + unsigned char pointer[8]; +}; + +struct vms_dsc_nca +{ + unsigned char length[2]; + unsigned char dtype; + unsigned char bclass; + unsigned char pointer[4]; + + unsigned char scale; + unsigned char digits; + unsigned char aflags; + unsigned char dimct; + + unsigned char arsize[4]; + unsigned char a0[4]; +}; + +struct vms_dsc_ubs +{ + unsigned char length[2]; + unsigned char dtype; + unsigned char bclass; + unsigned char base[4]; + unsigned char pos[4]; +}; + +#endif /* _VMS_DSC_H */ diff --git a/include/vms/dst.h b/include/vms/dst.h index d179018f529..231d3970870 100644 --- a/include/vms/dst.h +++ b/include/vms/dst.h @@ -38,10 +38,11 @@ struct vms_dst_header #define DST__K_MODBEG 188 /* Some well known languages. */ -#define DST__K_MACRO 0 -#define DST__K_BLISS 2 -#define DST__K_C 7 -#define DST__K_ADA 9 +#define DST__K_MACRO 0 +#define DST__K_BLISS 2 +#define DST__K_C 7 +#define DST__K_ADA 9 +#define DST__K_CXX 15 struct vms_dst_modbeg { @@ -79,15 +80,27 @@ struct vms_dst_pcline unsigned char field[4]; }; -#define DST__K_DELTA_PC_W 1 -#define DST__K_INCR_LINUM 2 -#define DST__K_INCR_LINUM_W 3 -#define DST__K_SET_LINUM 9 -#define DST__K_SET_LINUM_B 19 -#define DST__K_SET_LINUM_L 20 -#define DST__K_TERM 14 -#define DST__K_SET_ABS_PC 16 -#define DST__K_DELTA_PC_L 17 +#define DST__K_DELTA_PC_W 1 +#define DST__K_INCR_LINUM 2 +#define DST__K_INCR_LINUM_W 3 +#define DST__K_SET_LINUM_INCR 4 +#define DST__K_SET_LINUM_INCR_W 5 +#define DST__K_RESET_LINUM_INCR 6 +#define DST__K_BEG_STMT_MODE 7 +#define DST__K_END_STMT_MODE 8 +#define DST__K_SET_LINUM 9 +#define DST__K_SET_PC 10 +#define DST__K_SET_PC_W 11 +#define DST__K_SET_PC_L 12 +#define DST__K_SET_STMTNUM 13 +#define DST__K_TERM 14 +#define DST__K_TERM_W 15 +#define DST__K_SET_ABS_PC 16 +#define DST__K_DELTA_PC_L 17 +#define DST__K_INCR_LINUM_L 18 +#define DST__K_SET_LINUM_B 19 +#define DST__K_SET_LINUM_L 20 +#define DST__K_TERM_L 21 /* Routine end. */ #define DST__K_RTNEND 191 @@ -146,6 +159,7 @@ struct vms_dst_blkend #define DST__K_SRC_SETREC_W 4 #define DST__K_SRC_SETLNUM_L 5 #define DST__K_SRC_SETLNUM_W 6 +#define DST__K_SRC_INCRLNUM_B 7 #define DST__K_SRC_DEFLINES_W 10 #define DST__K_SRC_DEFLINES_B 11 #define DST__K_SRC_FORMFEED 16 @@ -162,4 +176,99 @@ struct vms_dst_src_decl_src /* Filename ASCIC. */ }; +/* Record begin. */ +#define DST__K_RECBEG 171 + +struct vms_dst_recbeg +{ + unsigned char vflags; + unsigned char value[4]; + /* Filename ASCIC. */ +}; + +/* Record end. */ +#define DST__K_RECEND 172 + +/* Enumeration begin. */ +#define DST__K_ENUMBEG 165 + +/* Enumeration element. */ +#define DST__K_ENUMELT 164 + +/* Enumeration end. */ +#define DST__K_ENUMEND 166 + +/* Separate type specification. */ +#define DST__K_SEPTYP 163 + +/* Type specification. */ +#define DST__K_TYPSPEC 175 + +#define DST__K_TS_ATOM 1 /* Atomic. */ +#define DST__K_TS_DSC 2 /* VMS Standard descriptor. */ +#define DST__K_TS_IND 3 /* Indirect. */ +#define DST__K_TS_TPTR 4 /* Typed pointer. */ +#define DST__K_TS_PTR 5 /* Pointer. */ +#define DST__K_TS_PIC 6 /* Pictured. */ +#define DST__K_TS_ARRAY 7 +#define DST__K_TS_SET 8 +#define DST__K_TS_SUBRANGE 9 /* Subrange. */ +#define DST__K_TS_ADA_DSC 10 /* Ada descriptor. */ +#define DST__K_TS_FILE 11 +#define DST__K_TS_AREA 12 /* Area (PL/I). */ +#define DST__K_TS_OFFSET 13 /* Offset (PL/I). */ +#define DST__K_TS_NOV_LENG 14 /* Novel Length. */ +#define DST__K_TS_IND_TSPEC 15 /* Internal to debugger. */ +#define DST__K_TS_SELF_REL_LABEL 16 /* Self-relative label (PL/I). */ +#define DST__K_TS_RFA 17 /* (Basic). */ +#define DST__K_TS_TASK 18 /* (Ada). */ +#define DST__K_TS_ADA_ARRAY 19 +#define DST__K_TS_XMOD_IND 20 /* Cross-module indirect type spec. */ +#define DST__K_TS_CONSTRAINED 21 /* (Ada). */ +#define DST__K_TS_MAYBE_CONSTR 22 /* Might-be-constrained (Ada). */ +#define DST__K_TS_DYN_LOV_LENG 23 +#define DST__K_TS_TPTR_D 24 /* Typed pointer to descriptor. */ +#define DST__K_TS_SCAN_TREE 25 +#define DST__K_TS_SCAN_TREEPTR 26 +#define DST__K_TS_INCOMPLETE 27 +#define DST__K_TS_BLISS_BLOCK 28 +#define DST__K_TS_TPTR_64 29 +#define DST__K_TS_PTR_64 30 +#define DST__K_TS_REF 31 /* C++ referenced type. */ +#define DST__K_TS_REF_64 32 + +/* Value Specification. */ +#define DST__K_VFLAGS_NOVAL 128 /* No value. */ +#define DST__K_VFLAGS_NOTACTIVE 248 /* Not active at current PC. */ +#define DST__K_VFLAGS_UNALLOC 249 /* Not allocated. */ +#define DST__K_VFLAGS_DSC 250 /* Descriptor format. */ +#define DST__K_VFLAGS_TVS 251 /* Trailing value spec. */ +#define DST__K_VS_FOLLOWS 253 /* Value specification follow. */ +#define DST__K_VFLAGS_BITOFFS 255 /* Value is a bit offset. */ + +/* Vflags fields. */ +#define DST__K_VALKIND_MASK 0x03 +#define DST__K_INDIR 0x04 +#define DST__K_DISP 0x08 +#define DST__K_REGNUM_MASK 0xf0 +#define DST__K_REGNUM_SHIFT 4 + +#define DST__K_VALKIND_LITERAL 0 +#define DST__K_VALKIND_ADDR 1 +#define DST__K_VALKIND_DESC 2 +#define DST__K_VALKIND_REG 3 + +/* Label. */ +#define DST__K_LABEL 187 + +struct vms_dst_label +{ + unsigned char unused; + + unsigned char value[4]; + unsigned char name[1]; +}; + +/* Discontiguous range. */ +#define DST__K_DIS_RANGE 118 #endif /* _VMS_DST_H */ diff --git a/include/vms/eeom.h b/include/vms/eeom.h index 36f4e56277c..807e44855e4 100644 --- a/include/vms/eeom.h +++ b/include/vms/eeom.h @@ -57,4 +57,6 @@ struct vms_eeom unsigned char tfradr[8]; }; +#define EEOM__M_WKTFR (1 << 0) /* Transfer address is weak. */ + #endif /* _VMS_EEOM_H */ diff --git a/include/vms/egps.h b/include/vms/egps.h index 2b099996ebe..e92df810b04 100644 --- a/include/vms/egps.h +++ b/include/vms/egps.h @@ -47,4 +47,18 @@ struct vms_egps unsigned char name[31]; }; +#define EGPS__V_PIC (1 << 0) /* Not meaningful. */ +#define EGPS__V_LIB (1 << 1) /* Defined in a shareable image. */ +#define EGPS__V_OVR (1 << 2) /* Overlaid contribution. */ +#define EGPS__V_REL (1 << 3) /* Relocatable. */ +#define EGPS__V_GBL (1 << 4) /* Global. */ +#define EGPS__V_SHR (1 << 5) /* Shareable. */ +#define EGPS__V_EXE (1 << 6) /* Executable. */ +#define EGPS__V_RD (1 << 7) /* Readable. */ +#define EGPS__V_WRT (1 << 8) /* Writable. */ +#define EGPS__V_VEC (1 << 9) /* Change mode dispatch or message vectors. */ +#define EGPS__V_NOMOD (1 << 10) /* Demand-zero. */ +#define EGPS__V_COM (1 << 11) /* Conditional storage. */ +#define EGPS__V_ALLOC_64BIT (1 << 12) /* Allocated in 64-bit space. */ + #endif /* _VMS_EGPS_H */ diff --git a/include/vms/egsd.h b/include/vms/egsd.h index 9a665cd3a5e..f9be3981aa8 100644 --- a/include/vms/egsd.h +++ b/include/vms/egsd.h @@ -57,5 +57,4 @@ struct vms_egsd_entry unsigned char gsdsiz[2]; }; - #endif /* _VMS_EGSD_H */ diff --git a/include/vms/egsy.h b/include/vms/egsy.h index 5add8794b81..dd36ab218c6 100644 --- a/include/vms/egsy.h +++ b/include/vms/egsy.h @@ -25,14 +25,14 @@ #define EGSY__W_FLAGS 6 -#define EGSY__V_WEAK 0x0001 -#define EGSY__V_DEF 0x0002 -#define EGSY__V_UNI 0x0004 -#define EGSY__V_REL 0x0008 -#define EGSY__V_COMM 0x0010 -#define EGSY__V_VECEP 0x0020 -#define EGSY__V_NORM 0x0040 -#define EGSY__V_QUAD_VAL 0x0080 +#define EGSY__V_WEAK 0x0001 /* Weak symbol definition. */ +#define EGSY__V_DEF 0x0002 /* Symbol definition. */ +#define EGSY__V_UNI 0x0004 /* Reserved. */ +#define EGSY__V_REL 0x0008 /* Relocatable (vs absolute). */ +#define EGSY__V_COMM 0x0010 /* Conditional symbol def. */ +#define EGSY__V_VECEP 0x0020 /* Reserved. */ +#define EGSY__V_NORM 0x0040 /* Normal procedure definition. */ +#define EGSY__V_QUAD_VAL 0x0080 /* Value exceed 32 bits. */ struct vms_egsy { diff --git a/include/vms/eiaf.h b/include/vms/eiaf.h index 37830da41b9..c3c39884c23 100644 --- a/include/vms/eiaf.h +++ b/include/vms/eiaf.h @@ -71,7 +71,7 @@ struct vms_eiaf unsigned char permctx[4]; /* Base address of the image itself. */ - unsigned char base_va[8]; + unsigned char base_va[4]; /* Offset to linkage pair with procedure signature fixups. */ unsigned char lppsbfixoff[4]; diff --git a/include/vms/eiha.h b/include/vms/eiha.h index d48817845d7..5965ef97920 100644 --- a/include/vms/eiha.h +++ b/include/vms/eiha.h @@ -45,6 +45,10 @@ struct vms_eiha /* Fourth (must be 0). */ unsigned char tfradr4[4]; unsigned char tfradr4_h[4]; + + /* Shared image initialization (only if EIHD__V_INISHR is set). */ + unsigned char inishr[4]; + unsigned char inishr_h[4]; }; #endif /* _VMS_EIHA_H */ diff --git a/include/vms/eihd.h b/include/vms/eihd.h index 771727e95a2..fdb3a6ec747 100644 --- a/include/vms/eihd.h +++ b/include/vms/eihd.h @@ -36,7 +36,7 @@ struct vms_eihd /* Byte offset to ISD (Image Section Descriptors) list. */ unsigned char isdoff[4]; - /* Byte offset to activation data. */ + /* Byte offset to activation data (off=16). */ unsigned char activoff[4]; /* Byte offset to symbol table and debugging data. */ @@ -48,13 +48,13 @@ struct vms_eihd /* Byte offset to patch data. */ unsigned char patchoff[4]; - /* RVA of fixup info. */ + /* RVA of fixup info (off=32). */ unsigned char iafva[8]; /* RVA of symbol vector. */ unsigned char symvva[8]; - /* Byte offset to version number array. */ + /* Byte offset to version number array (off=48). */ unsigned char version_array_off[4]; /* Image type. */ @@ -66,7 +66,7 @@ struct vms_eihd /* Size in bytes of image I/O section requested. */ unsigned char imgiocnt[4]; - /* Nbr of channels requested. */ + /* Nbr of channels requested (off=64). */ unsigned char iochancnt[4]; /* Requested privilege mask. */ @@ -113,6 +113,10 @@ struct vms_eihd #define EIHD__K_EXE 1 /* Executable image */ #define EIHD__K_LIM 2 /* Linkable image. */ +/* Image subtype. */ +#define EIHD__C_NATIVE 0 /* Alpha native image. */ +#define EIHD__C_CLI 1 /* Image is a CLI, run LOGINOUT. */ + /* Linker image flags. */ #define EIHD__M_LNKDEBUG 0x0001 /* Full debugging requested. */ #define EIHD__M_LNKNOTFR 0x0002 /* No first transfer address. */ @@ -129,7 +133,6 @@ struct vms_eihd #define EIHD__M_OMV_READY 0x1000 /* Can be processed by OMV. */ #define EIHD__M_EXT_BIND_SECT 0x2000 /* May be moved, using ext fixups. */ - /* Offsets of some fields. */ #define EIHD__L_SIZE 8 #define EIHD__L_ISDOFF 12 @@ -137,4 +140,6 @@ struct vms_eihd #define EIHD__Q_SYMVVA 40 #define EIHD__L_IMGTYPE 52 +#define EIHD__C_LENGTH 104 + #endif /* _VMS_EIHD_H */ diff --git a/include/vms/eihs.h b/include/vms/eihs.h index d5f1eaca7e4..cf048b13d34 100644 --- a/include/vms/eihs.h +++ b/include/vms/eihs.h @@ -59,5 +59,4 @@ struct vms_eihs #define EIHS__L_DMTVBN 24 #define EIHS__L_DMTBYTES 28 - #endif /* _VMS_EIHS_H */ diff --git a/include/vms/eihvn.h b/include/vms/eihvn.h index 7f587a39ca3..07f9eeed28c 100644 --- a/include/vms/eihvn.h +++ b/include/vms/eihvn.h @@ -52,5 +52,7 @@ struct vms_eihvn_subversion #define EIHVN__VOLATILE_BIT 15 #define EIHVN__SHELL_BIT 16 #define EIHVN__POSIX_BIT 17 +#define EIHVN__MULTI_PROCESSING_BIT 18 +#define EIHVN__GALAXY_BIT 19 #endif /* _VMS_EIHVN_H */ diff --git a/include/vms/eisd.h b/include/vms/eisd.h index b4e47e2c1cf..7579e72b829 100644 --- a/include/vms/eisd.h +++ b/include/vms/eisd.h @@ -33,13 +33,19 @@ #define EISD__M_FIXUPVEC 0x0040 /* Isect is fixup section. */ #define EISD__M_RESIDENT 0x0080 /* Isect is memory resident. */ #define EISD__M_VECTOR 0x0100 /* Vector contained in isect. */ -#define EISD__M_PROTECT 0x0200 /* Isect is proected. */ +#define EISD__M_PROTECT 0x0200 /* Isect is protected. */ #define EISD__M_LASTCLU 0x0400 /* Last cluster. */ #define EISD__M_EXE 0x0800 /* Code isect. */ #define EISD__M_NONSHRADR 0x1000 /* Contains non-shareable data. */ #define EISD__M_QUAD_LENGTH 0x2000 /* Quad length field valid. */ #define EISD__M_ALLOC_64BIT 0x4000 /* Allocate 64-bit space. */ +#define EISD__K_LEN 36 +#define EISD__K_LENEND 12 /* For end marker or next block. */ +#define EISD__K_MAXLENGLBL 84 + +#define EISD__K_GBLNAMLEN 44 /* Size of the field. */ + struct vms_eisd { unsigned char majorid[4]; @@ -70,17 +76,34 @@ struct vms_eisd unsigned char type; unsigned char fill_1; -}; -struct vms_eisd_ext -{ + /* End of structure for normal records. */ + /* Ident for global section. */ unsigned char ident[4]; - + /* Global name ascic. First 8 bytes are quad length field. */ - unsigned char gblnam[44]; + unsigned char gblnam[EISD__K_GBLNAMLEN]; }; +/* Versions. */ +#define EISD__K_MAJORID 1 +#define EISD__K_MINORID 1 + +/* Match control. */ +#define EISD__K_MATALL 0 /* Match always. */ +#define EISD__K_MATEQU 1 /* Match if equal. */ +#define EISD__K_MATLEQ 2 /* Match if less or equal. */ +#define EISD__K_MATNEV 3 /* Match never. */ + +/* Section type. */ +#define EISD__K_NORMAL 0 /* Normal program image section. */ +#define EISD__K_SHRFXD 1 /* Shareable fixed section. */ +#define EISD__K_PRVFXD 2 /* Private fixed section. */ +#define EISD__K_SHRPIC 3 /* Shareable pic section. */ +#define EISD__K_PRVPIC 4 /* Private PIC section. */ +#define EISD__K_USRSTACK 253 /* User stack section. */ + /* EISD offsets. */ #define EISD__L_EISDSIZE 8 diff --git a/include/vms/emh.h b/include/vms/emh.h index f373c377737..973d71ea6cf 100644 --- a/include/vms/emh.h +++ b/include/vms/emh.h @@ -62,6 +62,13 @@ struct vms_emh_mhd /* Compile data: ASCIC. */ }; +#define EOBJ__C_MAXRECSIZ 8192 /* Maximum legal record size. */ +#define EOBJ__C_STRLVL 2 /* Structure level. */ +#define EOBJ__C_SYMSIZ 64 /* Maximum symbol length. */ +#define EOBJ__C_SECSIZ 31 /* Maximum section name length. */ +#define EOBJ__C_STOREPLIM -1 /* Maximum repeat count on store commands. */ +#define EOBJ__C_PSCALILIM 16 /* Maximum p-sect alignment. */ + struct vms_emh_lnm { struct vms_emh_common common; diff --git a/include/vms/esdf.h b/include/vms/esdf.h index c75d33eb9cf..79ee3d61091 100644 --- a/include/vms/esdf.h +++ b/include/vms/esdf.h @@ -36,4 +36,6 @@ struct vms_esdf unsigned char name[31]; }; +#define ESDF__B_NAMLNG 32 + #endif /* _VMS_ESDF_H */ diff --git a/include/vms/esdfm.h b/include/vms/esdfm.h new file mode 100644 index 00000000000..e00e44a1345 --- /dev/null +++ b/include/vms/esdfm.h @@ -0,0 +1,49 @@ +/* Alpha VMS external format of Extended Symbol Definition for version Mask. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_ESDFM_H +#define _VMS_ESDFM_H + +struct vms_esdfm +{ + /* Entry type. */ + unsigned char gsdtyp[2]; + + /* Length of the entry. */ + unsigned char size[2]; + + /* Data type. */ + unsigned char datyp; + + /* Pad for alignment. */ + unsigned char temp; + + unsigned char flags[2]; + + unsigned char value[8]; + unsigned char psindx[4]; + unsigned char version_mask[4]; + unsigned char namlng; + unsigned char name[31]; +}; + +#endif /* _VMS_ESDFM_H */ diff --git a/include/vms/esdfv.h b/include/vms/esdfv.h new file mode 100644 index 00000000000..fae0dbc1867 --- /dev/null +++ b/include/vms/esdfv.h @@ -0,0 +1,49 @@ +/* Alpha VMS external format of Extended Symbol Def for Vectored symbols. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_ESDFV_H +#define _VMS_ESDFV_H + +struct vms_esdfv +{ + /* Entry type. */ + unsigned char gsdtyp[2]; + + /* Length of the entry. */ + unsigned char size[2]; + + /* Data type. */ + unsigned char datyp; + + /* Pad for alignment. */ + unsigned char temp; + + unsigned char flags[2]; + + unsigned char value[8]; + unsigned char psindx[4]; + unsigned char vector[4]; + unsigned char namlng; + unsigned char name[31]; +}; + +#endif /* _VMS_ESDFV_H */ diff --git a/include/vms/esrf.h b/include/vms/esrf.h index 93d78c86f7f..291250c96fc 100644 --- a/include/vms/esrf.h +++ b/include/vms/esrf.h @@ -31,4 +31,6 @@ struct vms_esrf unsigned char name[31]; }; +#define ESRF__B_NAMLNG 8 + #endif /* _VMS_ESRF_H */ diff --git a/include/vms/internal.h b/include/vms/internal.h new file mode 100644 index 00000000000..1c8c472451e --- /dev/null +++ b/include/vms/internal.h @@ -0,0 +1,63 @@ +/* Alpha VMS internal format. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_INTERNAL_H +#define _VMS_INTERNAL_H + +struct vms_internal_eisd +{ + unsigned int majorid; /* Version. */ + unsigned int minorid; + unsigned int eisdsize; /* Size (in bytes) of this eisd. */ + unsigned int secsize; /* Size (in bytes) of the section. */ + bfd_vma virt_addr; /* Virtual address of the section. */ + unsigned int flags; /* Flags. */ + unsigned int vbn; /* Base virtual block number. */ + unsigned char pfc; /* Page fault cluster. */ + unsigned char matchctl; /* Linker match control. */ + unsigned char type; /* Section type. */ +}; + +struct vms_internal_gbl_eisd +{ + struct vms_internal_eisd common; + + unsigned int ident; /* Ident for global section. */ + unsigned char gblnam[44]; /* Global name ascic. */ +}; + +struct vms_internal_eisd_map +{ + /* Next eisd in the list. */ + struct vms_internal_eisd_map *next; + + /* Offset in output file. */ + file_ptr file_pos; + + union + { + struct vms_internal_eisd eisd; + struct vms_internal_gbl_eisd gbl_eisd; + } u; +}; + +#endif /* _VMS_INTERNAL_H */ diff --git a/include/vms/lbr.h b/include/vms/lbr.h new file mode 100644 index 00000000000..768bc4c4ffc --- /dev/null +++ b/include/vms/lbr.h @@ -0,0 +1,255 @@ +/* Alpha VMS external format of Libraries. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_LBR_H +#define _VMS_LBR_H + +/* Libray HeaDer. */ + +#define LHD_SANEID_DCX 319232342 +#define LHD_SANEID3 233579905 +#define LHD_SANEID4 233579911 + +/* Library type. */ +#define LBR__C_TYP_UNK 0 /* Unknown / unspecified. */ +#define LBR__C_TYP_OBJ 1 /* Vax object. */ +#define LBR__C_TYP_MLB 2 /* Macro. */ +#define LBR__C_TYP_HLP 3 /* Help. */ +#define LBR__C_TYP_TXT 4 /* Text. */ +#define LBR__C_TYP_SHSTB 5 /* Vax shareable image. */ +#define LBR__C_TYP_NCS 6 /* NCS. */ +#define LBR__C_TYP_EOBJ 7 /* Alpha object. */ +#define LBR__C_TYP_ESHSTB 8 /* Alpha shareable image. */ +#define LBR__C_TYP_IOBJ 9 /* IA-64 object. */ + +struct vms_lhd +{ + /* Type of the library. See above. */ + unsigned char type; + + /* Number of indexes. Generally 1, 2 for object libraries. */ + unsigned char nindex; + + unsigned char fill_1[2]; + + /* Sanity Id. */ + unsigned char sanity[4]; + + /* Version. */ + unsigned char majorid[2]; + unsigned char minorid[2]; + + /* Tool name. */ + unsigned char lbrver[32]; + + /* Create time. */ + unsigned char credat[8]; + + /* Update time. */ + unsigned char updtim[8]; + + /* Size of the MHD. */ + unsigned char mhdusz; + + unsigned char idxblkf[2]; /* Unused. */ + unsigned char fill_2; + unsigned char closerror[2]; + + unsigned char spareword[2]; + + /* First free block, and number of free blocks. */ + unsigned char freevbn[4]; + unsigned char freeblk[4]; + + unsigned char nextrfa[6]; + unsigned char nextvbn[4]; + + /* Free pre-allocated index block. */ + unsigned char freidxblk[4]; + unsigned char freeidx[4]; + + /* Highest pre-allocated index block and in use. */ + unsigned char hipreal[4]; + unsigned char hiprusd[4]; + + /* Number of index blocks in use. */ + unsigned char idxblks[4]; + + /* Number of index entries. */ + unsigned char idxcnt[4]; + + /* Number of modules entries. */ + unsigned char modcnt[4]; + + unsigned char fill_3[2]; + + /* Number of module headers. */ + unsigned char modhdrs[4]; + + /* Overhead index pointers. */ + unsigned char idxovh[4]; + + /* Update history records. */ + unsigned char maxluhrec[2]; + unsigned char numluhrec[2]; + unsigned char begluhrfa[6]; + unsigned char endluhrfa[6]; + + /* DCX map. */ + unsigned char dcxmapvbn[4]; + + unsigned char fill_4[4 * 13]; +}; + +/* Offset of the first IDD. */ +#define LHD_IDXDESC 196 + +/* InDex Description. */ +struct vms_idd +{ + unsigned char flags[2]; + + /* Max length of the key. */ + unsigned char keylen[2]; + + /* First index block. */ + unsigned char vbn[4]; +}; + +/* IDD flags. */ +#define IDD__FLAGS_ASCII 1 +#define IDD__FLAGS_LOCKED 2 +#define IDD__FLAGS_VARLENIDX 4 +#define IDD__FLAGS_NOCASECMP 8 +#define IDD__FLAGS_NOCASENTR 16 +#define IDD__FLAGS_UPCASNTRY 32 + +#define IDD_LENGTH 8 + +/* Index block. */ +#define INDEXDEF__LENGTH 512 +#define INDEXDEF__BLKSIZ 500 + +struct vms_indexdef +{ + /* Number of bytes used. */ + unsigned char used[2]; + + /* VBN of the parent. */ + unsigned char parent[4]; + + unsigned char fill_1[6]; + unsigned char keys[INDEXDEF__BLKSIZ]; +}; + +/* Index keys. */ +struct vms_idxdef +{ + unsigned char vbn[4]; + unsigned char offset[2]; + + unsigned char keylen; + unsigned char keyname[256]; +}; + +struct vms_idxdef2 +{ + unsigned char vbn[4]; + + /* Offset from the start of the vbn, so minimum should be + DATA__DATA (ie 6). */ + unsigned char offset[2]; + + unsigned char keylen[2]; + unsigned char fill_1; + unsigned char keyname[256]; +}; + +#define RFADEF__C_INDEX 0xffff + +struct vms_datadef +{ + /* Number of records in this block. */ + unsigned char recs; + unsigned char fill_1; + + /* Next vbn. */ + unsigned char link[4]; + + /* Data. The first word is the record length, followed by record + data and a possible pad byte so that record length is always aligned. */ + unsigned char data[506]; +}; +#define DATA__LENGTH 512 +#define DATA__DATA 6 + +/* Module header. */ +struct vms_mhd +{ + /* Fixed part. */ + unsigned char lbrflag; + unsigned char id; + unsigned char fill_1[2]; + unsigned char refcnt[4]; + unsigned char datim[8]; + + unsigned char objstat; + /* Ident or GSMATCH. */ + unsigned char objidlng; + unsigned char objid[31]; +}; + +#define MHD__C_MHDID 0xad /* Value for id. */ +#define MHD__C_USRDAT 16 +#define MHD__M_SELSRC 0x1 +#define MHD__M_OBJTIR 0x2 +#define MHD__M_WKSYM 0x4 + +struct vms_luh +{ + unsigned char nxtluhblk[4]; + unsigned char spare[2]; + unsigned char data[506]; +}; + +struct vms_luhdef +{ + unsigned char rechdr[2]; + unsigned char reclen[2]; +}; +#define LUH__RECHDRLEN 4 +#define LUH__RECHDRMRK 0xabba +#define LUH__DATAFLDLEN 506 + +/* Entry in the history. */ + +struct vms_leh +{ + unsigned char date[8]; + unsigned char nbr_units[2]; + unsigned char action[2]; /* 1: delete, 2: insert, 3: replaced. */ + unsigned char idlen; + /* username + modules... */ +}; + +#endif /* _VMS_LBR_H */ diff --git a/include/vms/prt.h b/include/vms/prt.h new file mode 100644 index 00000000000..8b8d27b5645 --- /dev/null +++ b/include/vms/prt.h @@ -0,0 +1,43 @@ +/* Alpha VMS external format of Protection values. + + Copyright 2010 Free Software Foundation, Inc. + Written by Tristan Gingold , AdaCore. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _VMS_PRT_H +#define _VMS_PRT_H + +#define PRT__C_NA 0 /* No access. */ +#define PRT__C_RESERVED 1 +#define PRT__C_KW 2 /* Kernel RW. */ +#define PRT__C_KR 3 /* Kernel RO. */ +#define PRT__C_UW 4 /* User RW. */ +#define PRT__C_EW 5 /* Executive RW. */ +#define PRT__C_ERKW 6 /* Executive RO, Kernel RW. */ +#define PRT__C_ER 7 /* Executive RO. */ +#define PRT__C_SW 8 /* Supervisor RW. */ +#define PRT__C_SREW 9 /* Supervisor RO, Executive RW. */ +#define PRT__C_SRKW 10 /* Supervisor RO, Kernel RW. */ +#define PRT__C_SR 11 /* Supervisor RO. */ +#define PRT__C_URSW 12 /* User RO, Supervisor RW. */ +#define PRT__C_UREW 13 /* User RO, Executive RW. */ +#define PRT__C_URKW 14 /* User RO, Kernel RW. */ +#define PRT__C_UR 15 /* User RO. */ + +#endif /* _VMS_PRT_H */ diff --git a/include/vms/shl.h b/include/vms/shl.h index f93d9dd5bc6..d1d9fae92dc 100644 --- a/include/vms/shl.h +++ b/include/vms/shl.h @@ -37,11 +37,15 @@ struct vms_shl /* Permanent shareable image context. */ unsigned char permctx[4]; + /* Size of this structure. */ unsigned char size; + unsigned char fill_1[2]; + + /* Flags. */ unsigned char flags; - /* Address of the image control block. */ + /* Address of the image control block (in memory). */ unsigned char icb[4]; /* Image name. ASCIC. */ -- 2.30.2