/* VMS object file format
- Copyright (C) 1989, 1990, 1991, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000,
+ 2002, 2003 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+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, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
/* Tag to validate a.out object file format processing */
#define OBJ_VMS 1
#include "targ-cpu.h"
+#define LONGWORD_ALIGNMENT 2
+
/* This macro controls subsection alignment within a section.
*
* Under VAX/VMS, the linker (and PSECT specifications)
* Doing the alignment here (on initialized data) can
* mess up the calculation of global data PSECT sizes.
*/
-#define SUB_SEGMENT_ALIGN(SEG) (((SEG) == data_section) ? 0 : 2)
+#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \
+ (((SEG) == data_section) ? 0 : LONGWORD_ALIGNMENT)
/* 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
#define IN_DEFAULT_SECTION 0x80
-/* These are defined in obj-vms.c. */
+/* These are defined in obj-vms.c. */
extern const short seg_N_TYPE[];
extern const segT N_TYPE_seg[];
};
#define N_BADMAG(x) (0)
-#define N_TXTOFF(x) ( sizeof(struct exec) )
+#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 )
typedef struct
{
struct exec header; /* a.out header */
- long string_table_size; /* names + '\0' + sizeof(int) */
+ long string_table_size; /* names + '\0' + sizeof (int) */
}
object_headers;
/*
* Macros to extract information from a symbol table entry.
- * This syntaxic indirection allows independence regarding a.out or coff.
+ * This syntactic 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 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_COMMON(s) (S_GET_TYPE(s) == N_UNDF && S_GET_VALUE(s) != 0)
+
+/* Return true for symbols that should not be reduced to section
+ symbols or eliminated from expressions, because they may be
+ overridden by the linker. */
+#define S_FORCE_RELOC(s, strict) \
+ (!SEG_NORMAL (S_GET_SEGMENT (s)))
+
#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. */
+ 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' || \
+ (strchr(S_GET_NAME(s), '\001') != 0 || \
+ strchr(S_GET_NAME(s), '\002') != 0 || \
(S_LOCAL_NAME(s) && !flag_keep_locals)))
/* True if a symbol is not defined in this file */
#define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT)
/* Set the n_type expression value */
#define S_SET_TYPE(s,v) ((s)->sy_symbol.n_type = (v))
-
/* File header macro and type definition */
#define H_GET_TEXT_SIZE(h) ((h)->header.a_text)
#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))
+ sizeof (struct nlist))
-/* line numbering stuff. */
+/* line numbering stuff. */
#define OBJ_EMIT_LINENO(a, b, c) {;}
#define obj_symbol_new_hook(s) {;}
/* Force structure tags into scope so that their use in prototypes
- will never be their first occurance. */
+ will never be their first occurrence. */
struct fix;
-struct symbol;
struct frag;
/* obj-vms routines visible to the rest of gas. */
extern void tc_aout_fix_to_chars PARAMS ((char *,struct fix *,relax_addressT));
-extern int vms_resolve_symbol_redef PARAMS ((struct symbol *));
+extern int vms_resolve_symbol_redef PARAMS ((symbolS *));
#define RESOLVE_SYMBOL_REDEFINITION(X) vms_resolve_symbol_redef(X)
-/* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */
-extern void vms_check_for_special_label PARAMS ((struct symbol *));
-#define tc_frob_label(X) vms_check_for_special_label(X)
+/* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */
+extern void vms_check_for_special_label PARAMS ((symbolS *));
+#define obj_frob_label(X) vms_check_for_special_label(X)
extern void vms_check_for_main PARAMS ((void));
#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 */
+#define DST_S_C_SRC_DECLFILE 1 /* Declare source file */
+#define DST_S_C_SRC_SETFILE 2 /* Set source file */
+#define DST_S_C_SRC_SETREC_L 3 /* Set record, longword value */
+#define DST_S_C_SRC_SETREC_W 4 /* Set record, word value */
+#define DST_S_C_SRC_DEFLINES_W 10 /* # of line, word counter */
+#define DST_S_C_SRC_DEFLINES_B 11 /* # of line, byte counter */
+#define DST_S_C_SRC_FORMFEED 16 /* ^L counts as a record */
/* the following are the codes for the various data types. Anything not on
* the list is included under 'advanced_type'
*/
#define DBG_S_C_COMPLEX_ARRAY DST_K_TS_ARRAY
#endif /* WANT_VMS_OBJ_DEFS */
-
-/* end of obj-vms.h */