vms stuff from fsf version - untested
This commit is contained in:
parent
e087ffcc57
commit
be9618de59
4 changed files with 6243 additions and 0 deletions
248
gas/README-vms
Normal file
248
gas/README-vms
Normal file
|
@ -0,0 +1,248 @@
|
|||
This document explains a couple of things that are specific to VMS.
|
||||
There are currently two "chapters", the first deals with cross-assembly
|
||||
issues, and the second deals with the VMS debugger and GNU-CC.
|
||||
|
||||
|
||||
***********************************************************************
|
||||
****************** Notes for Cross Assembly with VMS ******************
|
||||
***********************************************************************
|
||||
|
||||
If you wish to build gas on a non-VMS system to cross-assemble,
|
||||
you should use:
|
||||
|
||||
configure ${hosttype} -target=vms
|
||||
|
||||
and then follow the usual procedure. The object files generated on
|
||||
Unix will be correct from a binary point of view, but the real trick is
|
||||
getting them to the VMS machine. The format of the object file is
|
||||
a variable-length record, but each record contains binary data. gas
|
||||
writes the records in the same format that VMS would expect,
|
||||
namely a two-byte count followed by that number of bytes.
|
||||
|
||||
If you try to copy the file to a VMS system using ftp, the ftp
|
||||
protocol will screw up the file by looking for nulls (record terminator for
|
||||
unix) and it will insert it's own record terminators at that point. This
|
||||
will obviously corrupt the file.
|
||||
|
||||
If you try to transfer the file with ftp in binary mode, the
|
||||
file itself will not be corrupt, but VMS will think that the file contains
|
||||
fixed-length records of 512 bytes. You can use the public-domain FILE
|
||||
utility to change this with a command like:
|
||||
|
||||
$FILE foo.o/type=variable
|
||||
|
||||
If you do not have this utility available, the following program can be
|
||||
used to perform this task:
|
||||
|
||||
#include <fab.h>
|
||||
|
||||
#define RME$C_SETRFM 1
|
||||
|
||||
struct FAB * fab;
|
||||
|
||||
main(int argc, char * argv[]){
|
||||
int i, status;
|
||||
fab = (struct FAB*) malloc(sizeof(struct FAB));
|
||||
*fab = cc$rms_fab; /* initialize FAB*/
|
||||
fab->fab$b_fac = FAB$M_PUT;
|
||||
fab->fab$l_fop |= FAB$M_ESC;
|
||||
fab->fab$l_ctx = RME$C_SETRFM;
|
||||
fab->fab$w_ifi = 0;
|
||||
for(i=1;i<argc;i++){
|
||||
printf("Setting %s to variable length records.\n",argv[i]);
|
||||
fab->fab$l_fna = argv[i];
|
||||
fab->fab$b_fns = strlen(argv[i]);
|
||||
status = sys$open(fab,0,0);
|
||||
if((status & 7) != 1) lib$signal(status);
|
||||
fab->fab$b_rfm = FAB$C_VAR;
|
||||
status = sys$modify(fab,0,0);
|
||||
if((status & 7) != 1) lib$signal(status);
|
||||
status = sys$close(fab,0,0);
|
||||
if((status & 7) != 1) lib$signal(status);
|
||||
};
|
||||
}
|
||||
|
||||
If you have NFS running on the VMS system, what you need to do
|
||||
depends upon which NFS software you are running on the VMS system. There
|
||||
are a number of different TCP/IP packages for VMS available, and only very
|
||||
limited testing has been performed. In the tests that has been done so
|
||||
far, the contents of the file will always be correct when transferring the
|
||||
file via NFS, but the record attributes may or may not be correct.
|
||||
|
||||
One proprietary TCP/IP/NFS package for VMS is known to
|
||||
automatically fix the record attributes of the object file if you NFS mount
|
||||
a unix disk from the VMS system, and if the file has a ".obj" extension on
|
||||
the unix system. Other TCP/IP packages might do this for you as well, but
|
||||
they have not been checked.
|
||||
|
||||
No matter what method you use to get the file to the VMS system, it is
|
||||
always a good idea to check to make sure that it is the correct type by
|
||||
doing a "$dir/full" on the object file. The desired record attributes will
|
||||
be "None". Undesirable record attributes will be "Stream-LF" or anything
|
||||
else.
|
||||
|
||||
Once you get the files on the VMS system, you can check their integrity
|
||||
with the "$anal/obj" command. (Naturally at some point you should rename
|
||||
the .o files to .obj). As far as the debugger is concerned, the records
|
||||
will be correct, but the debugger will not be able to find the source files,
|
||||
since it only has the file name, and not the full directory specification.
|
||||
You must give the debugger some help by telling it which directories to
|
||||
search for the individual files - once you have done this you should be
|
||||
able to proceed normally.
|
||||
|
||||
It is a good idea to use names for your files which will be valid
|
||||
under VMS, since otherwise you will have no way of getting the debugger to
|
||||
find the source file when deugging.
|
||||
|
||||
The reason for this is that the object file normally contins specific
|
||||
information that the debugger can use to positively identify a file, and if
|
||||
you are assembling on a unix system this information simply does not exist
|
||||
in a meaningful way. You must help the debugger by using the "SET FILE="
|
||||
command to tell the debugger where to look for source files. The debugger
|
||||
records will be correct, except that the debugger will not be initially
|
||||
able to find the source files. You can use the "SET FILE" command to tell
|
||||
the debugger where to look for the source files.
|
||||
|
||||
I have only tested this with a SVr4 i486 machine, and everything seems to
|
||||
work OK, with the limited testing that I have done. Other machines may
|
||||
or may not work. You should read the chapters on cross-compilers in the gcc
|
||||
manual before fooling with this. Since gas does not need to do any floating
|
||||
point arithmetic, the floating point constants that are generated here should
|
||||
be correct - the only concern is with constant folding in the main compiler.
|
||||
The range and precision of floats and doubles are similar on the 486 (with
|
||||
a builtin 80387) and the VAX, although there is a factor of 2 to 4
|
||||
difference in the range. The double, as implemented on the 486, is quite
|
||||
similar to the G_FLOAT on the VAX.
|
||||
|
||||
***********************************************************************
|
||||
****************** Notes for using GNU CC with the VMS debugger********
|
||||
***********************************************************************
|
||||
|
||||
|
||||
1) You should be aware that GNU-C, as with any other decent compiler,
|
||||
will do things when optimization is turned on that you may not expect.
|
||||
Sometimes intermediate results are not written to variables, if they are only
|
||||
used in one place, and sometimes variables that are not used at all will not be
|
||||
written to the symbol table. Also, parameters to inline functions are often
|
||||
inaccessible. You can see the assembly code equivalent by using KP7 in the
|
||||
debugger, and from this you can tell if in fact a variable should have the
|
||||
value that you expect. You can find out if a variable lives withing a register
|
||||
by doing a 'show symbol/addr'.
|
||||
|
||||
2) Overly complex data types, such as:
|
||||
|
||||
int (*(*(*(*(*(* sarr6)[1])[1])[2])[3])[4])[5];
|
||||
|
||||
will not be debugged properly, since the debugging record overflows an internal
|
||||
debugger buffer. gcc-as will convert these to *void as far as the debugger
|
||||
symbol table is concerned, which will avoid any problems, and the assembler
|
||||
will give you a message informing you that this has happened.
|
||||
|
||||
3) You must, of course, compile and link with /debug. If you link
|
||||
without debug, you still get traceback table in the executable, but there is no
|
||||
symbol table for variables.
|
||||
|
||||
4) Included in the patches to VMS.C are fixes to two bugs that are
|
||||
unrelated to the changes that I have made. One of these made it impossible to
|
||||
debug small programs sometimes, and the other caused the debugger to become
|
||||
confused about which routine it was in, and give this incorrect info in
|
||||
tracebacks.
|
||||
|
||||
5) If you are using the GNU-C++ compiler, you should modify the
|
||||
compiler driver file GNU_CC:[000000]GCC.COM (or GXX.COM). If you have a
|
||||
seperate GXX.COM, then you need to change one line in GXX.COM to:
|
||||
$ if f$locate("D",p2) .ne. P2_Length then Debug = " ""-G0"""
|
||||
Notice zero---> ^
|
||||
If you are using a GCC.COM that does both C and C++, add the following lines to
|
||||
GCC.COM:
|
||||
|
||||
$!
|
||||
$! Use old style debugging records for VMS
|
||||
$!
|
||||
$ if (Debug.nes."" ).and. Plus then Debug = " ""-G0"""
|
||||
|
||||
after the variables Plus and Debug are set. The reason for this, is that C++
|
||||
compiler by default generates debugging records that are more complex,
|
||||
with many new syntactical elements that allow for the new features of the
|
||||
language. The -G0 switch tells the C++ compiler to use the old style debugging
|
||||
records. Until the debugger understands C++ there is not any point to try and
|
||||
use the expanded syntax.
|
||||
|
||||
6) When you have nested scopes, i.e.:
|
||||
main(){
|
||||
int i;
|
||||
{int i;
|
||||
{int i;
|
||||
};};}
|
||||
and you say "EXAM i" the debugger needs to figure out which variable you
|
||||
actually want to reference. I have arranged things to define a block to the
|
||||
debugger when you use brackets to enter a new scope, so in the example above,
|
||||
the variables would be described as:
|
||||
TEST\main\i
|
||||
TEST\main\$0\i
|
||||
TEST\main\$0\$0\i
|
||||
At each level, the block name is a number with a dollar sign prefix, the
|
||||
numbers start with 0 and count upward. When you say EXAM i, the debugger looks
|
||||
at the current PC, and decides which block it is currently in. It works from
|
||||
the innermost level outward until it finds a block that has the variable "i"
|
||||
defined. You can always specify the scope explicitly.
|
||||
|
||||
7) With C++, there can be a lot of inline functions, and it would be
|
||||
rather restrictive to force the user to debug the program by converting all of
|
||||
the inline functions to normal functions. What I have done is to essentially
|
||||
"add" (with the debugger) source lines from the include files that contain the
|
||||
inline functions. Thus when you step into an inline function it appears as if
|
||||
you have called the function, and you can examine variables and so forth.
|
||||
There are several *very* important differences, however. First of all, since
|
||||
there is no function call involved, you cannot step over the inline function
|
||||
call - you always step into it. Secondly, since the same source lines are used
|
||||
in many locations, there is a seperate copy of the source for *each* usage.
|
||||
Without this, breakpoints do not work, since we must have a 1-to-1 mapping
|
||||
between source lines and PC.
|
||||
Since you cannot step over inline function calls, it can be a real pain
|
||||
if you are not really interested in what is going on for that function call.
|
||||
What I have done is to use the "-D" switch for the assembler to toggle the
|
||||
following behavior. With the "-D" switch, all inline functions are included in
|
||||
the object file, and you can debug everything. Without the "-D" switch
|
||||
(default case with VMS implementation), inline functions are included *only* if
|
||||
they did not come from system header files (i.e. from GNU_CC_INCLUDE: or
|
||||
GNU_GXX_INCLUDE:). Thus, without the switch the user only debugs his/her own
|
||||
inline functions, and not the system ones. (This is especially useful if you do
|
||||
a lot of stream I/O in C++). This probably will not provide enough granularity
|
||||
for many users, but for now this is still somewhat experimental, and I would
|
||||
like to reflect upon it and get some feedback before I go any further.
|
||||
Possible solutions include an interactive prompting, a logical name, or a new
|
||||
command line option in gcc.c (which is then passed through somehow to the guts
|
||||
of the assembler).
|
||||
The inline functions from header files appear after the source code
|
||||
for the source file. This has the advantage that the source file itself is
|
||||
numbered with the same line numbers that you get with an editor. In addition,
|
||||
the entire header file is not included, since the assembler makes a list of
|
||||
the min and max source lines that are used, and only includes those lines from
|
||||
the first to the last actually used. (It is easy to change it to include the
|
||||
whole file).
|
||||
|
||||
8) When you are debugging C++ objects, the object "this" is refered to
|
||||
as "$this". Actually, the compiler writes it as ".this", but the period is
|
||||
not good for the debugger, so I have a routine to convert it to a $. (It
|
||||
actually converts all periods to $, but only for variables, since this was
|
||||
intended to allow us to access "this".
|
||||
|
||||
9) If you use the asm("...") keyword for global symbols, you will not
|
||||
be able to see that symbol with the debugger. The reason is that there are two
|
||||
records for the symbol stored in the data structures of the assembler. One
|
||||
contains the info such as psect number and offset, and the other one contains
|
||||
the information having to do with the data type of the variable. In order to
|
||||
debug as symbol, you need to be able to coorelate these records, and the only
|
||||
way to do this is by name. The record with the storage attributes will take
|
||||
the name used in the asm directive, and the record that specifies the data type
|
||||
has the actual variable name, and thus when you use the asm directive to change
|
||||
a variable name, the symbol becomes invisible.
|
||||
|
||||
10) Older versions of the compiler ( GNU-C 1.37.92 and earlier) place
|
||||
global constants in the text psect. This is unfortunate, since to the linker
|
||||
this appears to be an entry point. I sent a patch to the compiler to RMS,
|
||||
which will generate a .const section for these variables, and patched the
|
||||
assembler to put these variables into a psect just like that for normal
|
||||
variables, except that they are marked NOWRT. static constants are still
|
||||
placed in the text psect, since there is no need for any external access.
|
30
gas/config/ho-vms.h
Normal file
30
gas/config/ho-vms.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* ho-vax.h Intended for vax vms
|
||||
Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
GAS 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 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GAS 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 GAS; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define HO_VAX 1
|
||||
|
||||
#include "ho-vax.h"
|
||||
|
||||
/* We get better performance if we use the macros rather than the functions.*/
|
||||
#include <ctype.h>
|
||||
|
||||
/* We need this to make sure that sys_nerr has the right Psect hack. */
|
||||
#include <perror.h>
|
||||
|
||||
/* end of ho-vms.h */
|
5484
gas/config/obj-vms.c
Normal file
5484
gas/config/obj-vms.c
Normal file
File diff suppressed because it is too large
Load diff
481
gas/config/obj-vms.h
Normal file
481
gas/config/obj-vms.h
Normal file
|
@ -0,0 +1,481 @@
|
|||
/* VMS object file format
|
||||
Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
GAS 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 2,
|
||||
or (at your option) any later version.
|
||||
|
||||
GAS 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 GAS; see the file COPYING. If not, write
|
||||
to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Tag to validate a.out object file format processing */
|
||||
#define OBJ_VMS 1
|
||||
|
||||
#include "targ-cpu.h"
|
||||
|
||||
/* This flag is used to remember whether we are in the const or the
|
||||
data section. By and large they are identical, but we set a no-write
|
||||
bit for psects in the const section. */
|
||||
|
||||
extern char const_flag;
|
||||
|
||||
|
||||
/* These are defined in obj-vms.c. */
|
||||
extern const short seg_N_TYPE[];
|
||||
extern const segT N_TYPE_seg[];
|
||||
|
||||
enum reloc_type
|
||||
{
|
||||
NO_RELOC, RELOC_32
|
||||
};
|
||||
|
||||
#define N_BADMAG(x) (0)
|
||||
#define N_TXTOFF(x) ( sizeof(struct exec) )
|
||||
#define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text )
|
||||
#define N_TROFF(x) ( N_DATOFF(x) + (x).a_data )
|
||||
#define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize )
|
||||
#define N_SYMOFF(x) ( N_DROFF(x) + (x).a_drsize )
|
||||
#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
|
||||
|
||||
/* We use this copy of the exec header for VMS. We do not actually use it, but
|
||||
what we actually do is let gas fill in the relevant slots, and when we get
|
||||
around to writing an obj file, we just pick out what we need. */
|
||||
|
||||
struct exec
|
||||
{
|
||||
unsigned long a_text; /* length of text, in bytes */
|
||||
unsigned long a_data; /* length of data, in bytes */
|
||||
unsigned long a_bss; /* length of uninitialized data area for file, in bytes */
|
||||
unsigned long a_trsize; /* length of relocation info for text, in bytes */
|
||||
unsigned long a_drsize; /* length of relocation info for data, in bytes */
|
||||
unsigned long a_entry; /* start address */
|
||||
unsigned long a_syms; /* length of symbol table data in file, in bytes */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct exec header; /* a.out header */
|
||||
long string_table_size; /* names + '\0' + sizeof(int) */
|
||||
}
|
||||
|
||||
object_headers;
|
||||
|
||||
/* A single entry in the symbol table
|
||||
*/
|
||||
struct nlist
|
||||
{
|
||||
union
|
||||
{
|
||||
char *n_name;
|
||||
struct nlist *n_next;
|
||||
long n_strx; /* Index into string table */
|
||||
}
|
||||
n_un;
|
||||
unsigned char n_type; /* See below */
|
||||
char n_other; /* Used in i80960 support -- see below */
|
||||
short n_desc;
|
||||
unsigned long n_value;
|
||||
};
|
||||
|
||||
/* Legal values of n_type
|
||||
*/
|
||||
#define N_UNDF 0 /* Undefined symbol */
|
||||
#define N_ABS 2 /* Absolute symbol */
|
||||
#define N_TEXT 4 /* Text symbol */
|
||||
#define N_DATA 6 /* Data symbol */
|
||||
#define N_BSS 8 /* BSS symbol */
|
||||
#define N_FN 31 /* Filename symbol */
|
||||
|
||||
#define N_EXT 1 /* External symbol (OR'd in with one of above) */
|
||||
#define N_TYPE 036 /* Mask for all the type bits */
|
||||
|
||||
#define N_STAB 0340 /* Mask for all bits used for SDB entries */
|
||||
|
||||
#define N_GSYM 0x20 /* global symbol: name,,0,type,0 */
|
||||
#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */
|
||||
#define N_FUN 0x24 /* procedure: name,,0,linenumber,address */
|
||||
#define N_STSYM 0x26 /* static symbol: name,,0,type,address */
|
||||
#define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */
|
||||
#define N_RSYM 0x40 /* register sym: name,,0,type,register */
|
||||
#define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */
|
||||
#define N_CATCH 0x54 /* */
|
||||
#define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */
|
||||
#define N_SO 0x64 /* source file name: name,,0,0,address */
|
||||
#define N_LSYM 0x80 /* local sym: name,,0,type,offset */
|
||||
#define N_SOL 0x84 /* #included file name: name,,0,0,address */
|
||||
#define N_PSYM 0xa0 /* parameter: name,,0,type,offset */
|
||||
#define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */
|
||||
#define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */
|
||||
#define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */
|
||||
#define N_BCOMM 0xe2 /* begin common: name,, */
|
||||
#define N_ECOMM 0xe4 /* end common: name,, */
|
||||
#define N_ECOML 0xe8 /* end common (local name): ,,address */
|
||||
#define N_LENG 0xfe /* second stab entry with length information */
|
||||
|
||||
/* SYMBOL TABLE */
|
||||
/* Symbol table entry data type */
|
||||
|
||||
typedef struct nlist obj_symbol_type; /* Symbol table entry */
|
||||
|
||||
/* Symbol table macros and constants */
|
||||
|
||||
/*
|
||||
* Macros to extract information from a symbol table entry.
|
||||
* This syntaxic indirection allows independence regarding a.out or coff.
|
||||
* The argument (s) of all these macros is a pointer to a symbol table entry.
|
||||
*/
|
||||
|
||||
/* True if the symbol is external */
|
||||
#define S_IS_EXTERNAL(s) ((s)->sy_symbol.n_type & N_EXT)
|
||||
|
||||
/* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
|
||||
#define S_IS_DEFINED(s) (S_GET_TYPE(s) != N_UNDF)
|
||||
|
||||
#define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER)
|
||||
|
||||
/* True if a debug special symbol entry */
|
||||
#define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB)
|
||||
/* True if a symbol is local symbol name */
|
||||
/* A symbol name whose name begin with ^A is a gas internal pseudo symbol
|
||||
nameless symbols come from .stab directives. */
|
||||
#define S_IS_LOCAL(s) (S_GET_NAME(s) && \
|
||||
!S_IS_DEBUG(s) && \
|
||||
(S_GET_NAME(s)[0] == '\001' || \
|
||||
(S_LOCAL_NAME(s) && !flagseen['L'])))
|
||||
/* True if a symbol is not defined in this file */
|
||||
#define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT)
|
||||
/* True if the symbol has been generated because of a .stabd directive */
|
||||
#define S_IS_STABD(s) (S_GET_NAME(s) == (char *)0)
|
||||
|
||||
/* Accessors */
|
||||
/* The value of the symbol */
|
||||
#define S_GET_VALUE(s) (((s)->sy_symbol.n_value))
|
||||
/* The name of the symbol */
|
||||
#define S_GET_NAME(s) ((s)->sy_symbol.n_un.n_name)
|
||||
/* The pointer to the string table */
|
||||
#define S_GET_OFFSET(s) ((s)->sy_symbol.n_un.n_strx)
|
||||
/* The raw type of the symbol */
|
||||
#define S_GET_RAW_TYPE(s) ((s)->sy_symbol.n_type)
|
||||
/* The type of the symbol */
|
||||
#define S_GET_TYPE(s) ((s)->sy_symbol.n_type & N_TYPE)
|
||||
/* The numeric value of the segment */
|
||||
#define S_GET_SEGMENT(s) (N_TYPE_seg[S_GET_TYPE(s)])
|
||||
/* The n_other expression value */
|
||||
#define S_GET_OTHER(s) ((s)->sy_symbol.n_other)
|
||||
/* The n_desc expression value */
|
||||
#define S_GET_DESC(s) ((s)->sy_symbol.n_desc)
|
||||
|
||||
/* Modifiers */
|
||||
/* Set the value of the symbol */
|
||||
#define S_SET_VALUE(s,v) ((s)->sy_symbol.n_value = (unsigned long) (v))
|
||||
/* Assume that a symbol cannot be simultaneously in more than on segment */
|
||||
/* set segment */
|
||||
#define S_SET_SEGMENT(s,seg) ((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type|=SEGMENT_TO_SYMBOL_TYPE(seg))
|
||||
/* The symbol is external */
|
||||
#define S_SET_EXTERNAL(s) ((s)->sy_symbol.n_type |= N_EXT)
|
||||
/* The symbol is not external */
|
||||
#define S_CLEAR_EXTERNAL(s) ((s)->sy_symbol.n_type &= ~N_EXT)
|
||||
/* Set the name of the symbol */
|
||||
#define S_SET_NAME(s,v) ((s)->sy_symbol.n_un.n_name = (v))
|
||||
/* Set the offset in the string table */
|
||||
#define S_SET_OFFSET(s,v) ((s)->sy_symbol.n_un.n_strx = (v))
|
||||
/* Set the n_other expression value */
|
||||
#define S_SET_OTHER(s,v) ((s)->sy_symbol.n_other = (v))
|
||||
/* Set the n_desc expression value */
|
||||
#define S_SET_DESC(s,v) ((s)->sy_symbol.n_desc = (v))
|
||||
|
||||
|
||||
/* File header macro and type definition */
|
||||
|
||||
#define H_GET_TEXT_SIZE(h) ((h)->header.a_text)
|
||||
#define H_GET_DATA_SIZE(h) ((h)->header.a_data)
|
||||
#define H_GET_BSS_SIZE(h) ((h)->header.a_bss)
|
||||
|
||||
#define H_SET_TEXT_SIZE(h,v) ((h)->header.a_text = md_section_align(SEG_TEXT, (v)))
|
||||
#define H_SET_DATA_SIZE(h,v) ((h)->header.a_data = md_section_align(SEG_DATA, (v)))
|
||||
#define H_SET_BSS_SIZE(h,v) ((h)->header.a_bss = md_section_align(SEG_BSS, (v)))
|
||||
|
||||
#define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v))
|
||||
#define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * \
|
||||
sizeof(struct nlist))
|
||||
|
||||
/*
|
||||
* Current means for getting the name of a segment.
|
||||
* This will change for infinite-segments support (e.g. COFF).
|
||||
*/
|
||||
#define segment_name(seg) ( seg_name[(int)(seg)] )
|
||||
extern char *const seg_name[];
|
||||
|
||||
|
||||
/* line numbering stuff. */
|
||||
#define OBJ_EMIT_LINENO(a, b, c) {;}
|
||||
|
||||
#define obj_symbol_new_hook(s) {;}
|
||||
|
||||
#ifdef __STDC__
|
||||
struct fix;
|
||||
void tc_aout_fix_to_chars (char *where, struct fix *fixP, relax_addressT segment_address);
|
||||
#else
|
||||
void tc_aout_fix_to_chars ();
|
||||
#endif /* __STDC__ */
|
||||
|
||||
/* The rest of this file contains definitions for constants used within the actual
|
||||
VMS object file. We do not use a $ in the symbols (as per usual VMS
|
||||
convention) since System V gags on it. */
|
||||
|
||||
#define OBJ_S_C_HDR 0
|
||||
#define OBJ_S_C_HDR_MHD 0
|
||||
#define OBJ_S_C_HDR_LNM 1
|
||||
#define OBJ_S_C_HDR_SRC 2
|
||||
#define OBJ_S_C_HDR_TTL 3
|
||||
#define OBJ_S_C_HDR_CPR 4
|
||||
#define OBJ_S_C_HDR_MTC 5
|
||||
#define OBJ_S_C_HDR_GTX 6
|
||||
#define OBJ_S_C_GSD 1
|
||||
#define OBJ_S_C_GSD_PSC 0
|
||||
#define OBJ_S_C_GSD_SYM 1
|
||||
#define OBJ_S_C_GSD_EPM 2
|
||||
#define OBJ_S_C_GSD_PRO 3
|
||||
#define OBJ_S_C_GSD_SYMW 4
|
||||
#define OBJ_S_C_GSD_EPMW 5
|
||||
#define OBJ_S_C_GSD_PROW 6
|
||||
#define OBJ_S_C_GSD_IDC 7
|
||||
#define OBJ_S_C_GSD_ENV 8
|
||||
#define OBJ_S_C_GSD_LSY 9
|
||||
#define OBJ_S_C_GSD_LEPM 10
|
||||
#define OBJ_S_C_GSD_LPRO 11
|
||||
#define OBJ_S_C_GSD_SPSC 12
|
||||
#define OBJ_S_C_TIR 2
|
||||
#define OBJ_S_C_EOM 3
|
||||
#define OBJ_S_C_DBG 4
|
||||
#define OBJ_S_C_TBT 5
|
||||
#define OBJ_S_C_LNK 6
|
||||
#define OBJ_S_C_EOMW 7
|
||||
#define OBJ_S_C_MAXRECTYP 7
|
||||
#define OBJ_S_K_SUBTYP 1
|
||||
#define OBJ_S_C_SUBTYP 1
|
||||
#define OBJ_S_C_MAXRECSIZ 2048
|
||||
#define OBJ_S_C_STRLVL 0
|
||||
#define OBJ_S_C_SYMSIZ 31
|
||||
#define OBJ_S_C_STOREPLIM -1
|
||||
#define OBJ_S_C_PSCALILIM 9
|
||||
|
||||
#define MHD_S_C_MHD 0
|
||||
#define MHD_S_C_LNM 1
|
||||
#define MHD_S_C_SRC 2
|
||||
#define MHD_S_C_TTL 3
|
||||
#define MHD_S_C_CPR 4
|
||||
#define MHD_S_C_MTC 5
|
||||
#define MHD_S_C_GTX 6
|
||||
#define MHD_S_C_MAXHDRTYP 6
|
||||
|
||||
#define GSD_S_K_ENTRIES 1
|
||||
#define GSD_S_C_ENTRIES 1
|
||||
#define GSD_S_C_PSC 0
|
||||
#define GSD_S_C_SYM 1
|
||||
#define GSD_S_C_EPM 2
|
||||
#define GSD_S_C_PRO 3
|
||||
#define GSD_S_C_SYMW 4
|
||||
#define GSD_S_C_EPMW 5
|
||||
#define GSD_S_C_PROW 6
|
||||
#define GSD_S_C_IDC 7
|
||||
#define GSD_S_C_ENV 8
|
||||
#define GSD_S_C_LSY 9
|
||||
#define GSD_S_C_LEPM 10
|
||||
#define GSD_S_C_LPRO 11
|
||||
#define GSD_S_C_SPSC 12
|
||||
#define GSD_S_C_SYMV 13
|
||||
#define GSD_S_C_EPMV 14
|
||||
#define GSD_S_C_PROV 15
|
||||
#define GSD_S_C_MAXRECTYP 15
|
||||
|
||||
#define GSY_S_M_WEAK 1
|
||||
#define GSY_S_M_DEF 2
|
||||
#define GSY_S_M_UNI 4
|
||||
#define GSY_S_M_REL 8
|
||||
|
||||
#define GPS_S_M_PIC 1
|
||||
#define GPS_S_M_LIB 2
|
||||
#define GPS_S_M_OVR 4
|
||||
#define GPS_S_M_REL 8
|
||||
#define GPS_S_M_GBL 16
|
||||
#define GPS_S_M_SHR 32
|
||||
#define GPS_S_M_EXE 64
|
||||
#define GPS_S_M_RD 128
|
||||
#define GPS_S_M_WRT 256
|
||||
#define GPS_S_M_VEC 512
|
||||
#define GPS_S_K_NAME 9
|
||||
#define GPS_S_C_NAME 9
|
||||
|
||||
#define TIR_S_C_STA_GBL 0
|
||||
#define TIR_S_C_STA_SB 1
|
||||
#define TIR_S_C_STA_SW 2
|
||||
#define TIR_S_C_STA_LW 3
|
||||
#define TIR_S_C_STA_PB 4
|
||||
#define TIR_S_C_STA_PW 5
|
||||
#define TIR_S_C_STA_PL 6
|
||||
#define TIR_S_C_STA_UB 7
|
||||
#define TIR_S_C_STA_UW 8
|
||||
#define TIR_S_C_STA_BFI 9
|
||||
#define TIR_S_C_STA_WFI 10
|
||||
#define TIR_S_C_STA_LFI 11
|
||||
#define TIR_S_C_STA_EPM 12
|
||||
#define TIR_S_C_STA_CKARG 13
|
||||
#define TIR_S_C_STA_WPB 14
|
||||
#define TIR_S_C_STA_WPW 15
|
||||
#define TIR_S_C_STA_WPL 16
|
||||
#define TIR_S_C_STA_LSY 17
|
||||
#define TIR_S_C_STA_LIT 18
|
||||
#define TIR_S_C_STA_LEPM 19
|
||||
#define TIR_S_C_MAXSTACOD 19
|
||||
#define TIR_S_C_MINSTOCOD 20
|
||||
#define TIR_S_C_STO_SB 20
|
||||
#define TIR_S_C_STO_SW 21
|
||||
#define TIR_S_C_STO_L 22
|
||||
#define TIR_S_C_STO_BD 23
|
||||
#define TIR_S_C_STO_WD 24
|
||||
#define TIR_S_C_STO_LD 25
|
||||
#define TIR_S_C_STO_LI 26
|
||||
#define TIR_S_C_STO_PIDR 27
|
||||
#define TIR_S_C_STO_PICR 28
|
||||
#define TIR_S_C_STO_RSB 29
|
||||
#define TIR_S_C_STO_RSW 30
|
||||
#define TIR_S_C_STO_RL 31
|
||||
#define TIR_S_C_STO_VPS 32
|
||||
#define TIR_S_C_STO_USB 33
|
||||
#define TIR_S_C_STO_USW 34
|
||||
#define TIR_S_C_STO_RUB 35
|
||||
#define TIR_S_C_STO_RUW 36
|
||||
#define TIR_S_C_STO_B 37
|
||||
#define TIR_S_C_STO_W 38
|
||||
#define TIR_S_C_STO_RB 39
|
||||
#define TIR_S_C_STO_RW 40
|
||||
#define TIR_S_C_STO_RIVB 41
|
||||
#define TIR_S_C_STO_PIRR 42
|
||||
#define TIR_S_C_MAXSTOCOD 42
|
||||
#define TIR_S_C_MINOPRCOD 50
|
||||
#define TIR_S_C_OPR_NOP 50
|
||||
#define TIR_S_C_OPR_ADD 51
|
||||
#define TIR_S_C_OPR_SUB 52
|
||||
#define TIR_S_C_OPR_MUL 53
|
||||
#define TIR_S_C_OPR_DIV 54
|
||||
#define TIR_S_C_OPR_AND 55
|
||||
#define TIR_S_C_OPR_IOR 56
|
||||
#define TIR_S_C_OPR_EOR 57
|
||||
#define TIR_S_C_OPR_NEG 58
|
||||
#define TIR_S_C_OPR_COM 59
|
||||
#define TIR_S_C_OPR_INSV 60
|
||||
#define TIR_S_C_OPR_ASH 61
|
||||
#define TIR_S_C_OPR_USH 62
|
||||
#define TIR_S_C_OPR_ROT 63
|
||||
#define TIR_S_C_OPR_SEL 64
|
||||
#define TIR_S_C_OPR_REDEF 65
|
||||
#define TIR_S_C_OPR_DFLIT 66
|
||||
#define TIR_S_C_MAXOPRCOD 66
|
||||
#define TIR_S_C_MINCTLCOD 80
|
||||
#define TIR_S_C_CTL_SETRB 80
|
||||
#define TIR_S_C_CTL_AUGRB 81
|
||||
#define TIR_S_C_CTL_DFLOC 82
|
||||
#define TIR_S_C_CTL_STLOC 83
|
||||
#define TIR_S_C_CTL_STKDL 84
|
||||
#define TIR_S_C_MAXCTLCOD 84
|
||||
|
||||
/*
|
||||
* Debugger symbol definitions: These are done by hand, as no
|
||||
* machine-readable version seems
|
||||
* to be available.
|
||||
*/
|
||||
#define DST_S_C_C 7 /* Language == "C" */
|
||||
#define DST_S_C_VERSION 153
|
||||
#define DST_S_C_SOURCE 155 /* Source file */
|
||||
#define DST_S_C_PROLOG 162
|
||||
#define DST_S_C_BLKBEG 176 /* Beginning of block */
|
||||
#define DST_S_C_BLKEND 177 /* End of block */
|
||||
#define DST_S_C_ENTRY 181
|
||||
#define DST_S_C_PSECT 184
|
||||
#define DST_S_C_LINE_NUM 185 /* Line Number */
|
||||
#define DST_S_C_LBLORLIT 186
|
||||
#define DST_S_C_LABEL 187
|
||||
#define DST_S_C_MODBEG 188 /* Beginning of module */
|
||||
#define DST_S_C_MODEND 189 /* End of module */
|
||||
#define DST_S_C_RTNBEG 190 /* Beginning of routine */
|
||||
#define DST_S_C_RTNEND 191 /* End of routine */
|
||||
#define DST_S_C_DELTA_PC_W 1 /* Incr PC */
|
||||
#define DST_S_C_INCR_LINUM 2 /* Incr Line # */
|
||||
#define DST_S_C_INCR_LINUM_W 3 /* Incr Line # */
|
||||
#define DST_S_C_SET_LINUM_INCR 4
|
||||
#define DST_S_C_SET_LINUM_INCR_W 5
|
||||
#define DST_S_C_RESET_LINUM_INCR 6
|
||||
#define DST_S_C_BEG_STMT_MODE 7
|
||||
#define DST_S_C_END_STMT_MODE 8
|
||||
#define DST_S_C_SET_LINE_NUM 9 /* Set Line # */
|
||||
#define DST_S_C_SET_PC 10
|
||||
#define DST_S_C_SET_PC_W 11
|
||||
#define DST_S_C_SET_PC_L 12
|
||||
#define DST_S_C_SET_STMTNUM 13
|
||||
#define DST_S_C_TERM 14 /* End of lines */
|
||||
#define DST_S_C_TERM_W 15 /* End of lines */
|
||||
#define DST_S_C_SET_ABS_PC 16 /* Set PC */
|
||||
#define DST_S_C_DELTA_PC_L 17 /* Incr PC */
|
||||
#define DST_S_C_INCR_LINUM_L 18 /* Incr Line # */
|
||||
#define DST_S_C_SET_LINUM_B 19 /* Set Line # */
|
||||
#define DST_S_C_SET_LINUM_L 20 /* Set Line # */
|
||||
#define DST_S_C_TERM_L 21 /* End of lines */
|
||||
/* these are used with DST_S_C_SOURCE */
|
||||
#define DST_S_C_SRC_FORMFEED 16 /* ^L counts */
|
||||
#define DST_S_C_SRC_DECLFILE 1 /* Declare file */
|
||||
#define DST_S_C_SRC_SETFILE 2 /* Set file */
|
||||
#define DST_S_C_SRC_SETREC_L 3 /* Set record */
|
||||
#define DST_S_C_SRC_DEFLINES_W 10 /* # of line */
|
||||
/* the following are the codes for the various data types. Anything not on
|
||||
* the list is included under 'advanced_type'
|
||||
*/
|
||||
#define DBG_S_C_UCHAR 0x02
|
||||
#define DBG_S_C_USINT 0x03
|
||||
#define DBG_S_C_ULINT 0x04
|
||||
#define DBG_S_C_SCHAR 0x06
|
||||
#define DBG_S_C_SSINT 0x07
|
||||
#define DBG_S_C_SLINT 0x08
|
||||
#define DBG_S_C_REAL4 0x0a
|
||||
#define DBG_S_C_REAL8 0x0b
|
||||
#define DBG_S_C_FUNCTION_ADDR 0x17
|
||||
#define DBG_S_C_ADVANCED_TYPE 0xa3
|
||||
/* These are the codes that are used to generate the definitions of struct
|
||||
* union and enum records
|
||||
*/
|
||||
#define DBG_S_C_ENUM_ITEM 0xa4
|
||||
#define DBG_S_C_ENUM_START 0xa5
|
||||
#define DBG_S_C_ENUM_END 0xa6
|
||||
#define DBG_S_C_STRUCT_START 0xab
|
||||
#define DBG_S_C_STRUCT_ITEM 0xff
|
||||
#define DBG_S_C_STRUCT_END 0xac
|
||||
/* These are the codes that are used in the suffix records to determine the
|
||||
* actual data type
|
||||
*/
|
||||
#define DBG_S_C_BASIC 0x01
|
||||
#define DBG_S_C_BASIC_ARRAY 0x02
|
||||
#define DBG_S_C_STRUCT 0x03
|
||||
#define DBG_S_C_POINTER 0x04
|
||||
#define DBG_S_C_VOID 0x05
|
||||
#define DBG_S_C_COMPLEX_ARRAY 0x07
|
||||
/* These codes are used in the generation of the symbol definition records
|
||||
*/
|
||||
#define DBG_S_C_FUNCTION_PARAMETER 0xc9
|
||||
#define DBG_S_C_LOCAL_SYM 0xd9
|
||||
/*
|
||||
* Local Variables:
|
||||
* comment-column: 0
|
||||
* fill-column: 131
|
||||
* End:
|
||||
*/
|
||||
|
||||
/* end of obj-vms.h */
|
Loading…
Reference in a new issue