obj-vms.h
来自「基于4个mips核的noc设计」· C头文件 代码 · 共 549 行 · 第 1/2 页
H
549 行
/* VMS object file format Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.This file is part of GAS, the GNU Assembler.GAS is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License aspublished 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, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Seethe GNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GAS; see the file COPYING. If not, write to the FreeSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA02111-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) * take care of correctly aligning the segments. * 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 : 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 bit for psects in the const section. */extern unsigned char const_flag;/* This is overloaded onto const_flag, for convenience. It's used to flag dummy labels like "gcc2_compiled." which occur before the first .text or .data section directive. */#define IN_DEFAULT_SECTION 0x80/* These are defined in obj-vms.c. */extern const short seg_N_TYPE[];extern const segT N_TYPE_seg[];#undef NO_RELOCenum 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 * (this started as a clone of bout.h's nlist, but much was unneeded). */struct nlist { char *n_name; unsigned char n_type; /* See below */ unsigned char n_other; /* used for const_flag and "default section" */ unsigned : 16; /* padding for alignment */ int n_desc; /* source line number for N_SLINE stabs */ };/* Legal values of n_type (see aout/stab.def for the majority of the codes). */#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 */#include "aout/stab_gnu.h"/* SYMBOL TABLE *//* Symbol table entry data type */typedef struct nlist obj_symbol_type; /* Symbol table entry *//* Symbol table macros and constants */#define OBJ_SYMFIELD_TYPE struct VMS_Symbol */* * 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_COMMON(s) (S_GET_TYPE(s) == N_UNDF && S_GET_VALUE(s) != 0)#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) && \ (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)/* 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 name of the symbol */#define S_GET_NAME(s) ((s)->sy_symbol.n_name)/* The pointer to the string table */#define S_GET_OFFSET(s) ((s)->sy_name_offset)/* 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 *//* 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_name = (v))/* Set the offset in the string table */#define S_SET_OFFSET(s,v) ((s)->sy_name_offset = (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))/* 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_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))/* 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. */struct fix;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 ((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 ((symbolS *));#define obj_frob_label(X) vms_check_for_special_label(X)extern void vms_check_for_main PARAMS ((void));extern void vms_write_object_file PARAMS ((unsigned,unsigned,unsigned, struct frag *,struct frag *));/* VMS executables are nothing like a.out, but the VMS port of gcc uses a.out format stabs which obj-vms.c then translates. */#define AOUT_STABS#ifdef WANT_VMS_OBJ_DEFS/* 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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?