obj-coff.h

来自「基于4个mips核的noc设计」· C头文件 代码 · 共 873 行 · 第 1/3 页

H
873
字号
/* coff object file format   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,   1999, 2000   Free Software Foundation, Inc.   This file is part of GAS.   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, 59 Temple Place - Suite 330, Boston, MA   02111-1307, USA.  */#ifndef OBJ_FORMAT_H#define OBJ_FORMAT_H#define OBJ_COFF 1#ifndef BFD_ASSEMBLER#define WORKING_DOT_WORD#define WARN_SIGNED_OVERFLOW_WORD#define OBJ_COFF_OMIT_OPTIONAL_HEADER#define BFD_HEADERS#define BFD#endif#include "targ-cpu.h"#include "bfd.h"/* This internal_lineno crap is to stop namespace pollution from the   bfd internal coff headerfile.  */#define internal_lineno bfd_internal_lineno#include "coff/internal.h"#undef internal_lineno/* CPU-specific setup:  */#ifdef TC_ARM#include "coff/arm.h"#ifndef TARGET_FORMAT#define TARGET_FORMAT "coff-arm"#endif#endif#ifdef TC_PPC#ifdef TE_PE#include "coff/powerpc.h"#else#include "coff/rs6000.h"#endif#endif#ifdef TC_SPARC#include "coff/sparc.h"#endif#ifdef TC_I386#include "coff/i386.h"#ifdef TE_PE#define TARGET_FORMAT "pe-i386"#endif#ifndef TARGET_FORMAT#define TARGET_FORMAT "coff-i386"#endif#endif#ifdef TC_M68K#include "coff/m68k.h"#ifndef TARGET_FORMAT#define TARGET_FORMAT "coff-m68k"#endif#endif#ifdef TC_A29K#include "coff/a29k.h"#define TARGET_FORMAT "coff-a29k-big"#endif#ifdef TC_I960#include "coff/i960.h"#define TARGET_FORMAT "coff-Intel-little"#endif#ifdef TC_Z8K#include "coff/z8k.h"#define TARGET_FORMAT "coff-z8k"#endif#ifdef TC_H8300#include "coff/h8300.h"#define TARGET_FORMAT "coff-h8300"#endif#ifdef TC_H8500#include "coff/h8500.h"#define TARGET_FORMAT "coff-h8500"#endif#ifdef TC_SH#ifdef TE_PE#define COFF_WITH_PE#endif#include "coff/sh.h"#ifdef TE_PE#define TARGET_FORMAT "pe-shl"#else#define TARGET_FORMAT					\  (shl							\   ? (sh_small ? "coff-shl-small" : "coff-shl")		\   : (sh_small ? "coff-sh-small" : "coff-sh"))#endif#endif#ifdef TC_MIPS#define COFF_WITH_PE#include "coff/mipspe.h"#undef  TARGET_FORMAT#define TARGET_FORMAT "pe-mips"#endif#ifdef TC_M88K#include "coff/m88k.h"#define TARGET_FORMAT "coff-m88kbcs"#endif#ifdef TC_W65#include "coff/w65.h"#define TARGET_FORMAT "coff-w65"#endif#ifdef TC_TIC30#include "coff/tic30.h"#define TARGET_FORMAT "coff-tic30"#endif#ifdef TC_TIC54X#include "coff/tic54x.h"#define TARGET_FORMAT "coff1-c54x"#endif#ifdef TC_TIC80#include "coff/tic80.h"#define TARGET_FORMAT "coff-tic80"#define ALIGNMENT_IN_S_FLAGS 1#endif#ifdef TC_MCORE#include "coff/mcore.h"#ifndef TARGET_FORMAT#define TARGET_FORMAT "pe-mcore"#endif#endif/* Targets may also set this.  Also, if BFD_ASSEMBLER is defined, this   will already have been defined.  */#undef SYMBOLS_NEED_BACKPOINTERS#define SYMBOLS_NEED_BACKPOINTERS 1#ifndef OBJ_COFF_MAX_AUXENTRIES#define OBJ_COFF_MAX_AUXENTRIES 1#endif /* OBJ_COFF_MAX_AUXENTRIES */extern void coff_obj_symbol_new_hook PARAMS ((symbolS *));#define obj_symbol_new_hook coff_obj_symbol_new_hookextern void coff_obj_read_begin_hook PARAMS ((void));#define obj_read_begin_hook coff_obj_read_begin_hook/* ***********************************************************************   This file really contains two implementations of the COFF back end.   They are in the process of being merged, but this is only a   preliminary, mechanical merging.  Many definitions that are   identical between the two are still found in both versions.   The first version, with BFD_ASSEMBLER defined, uses high-level BFD   interfaces and data structures.  The second version, with   BFD_ASSEMBLER not defined, also uses BFD, but mostly for swapping   data structures and for doing the actual I/O.  The latter defines   the preprocessor symbols BFD and BFD_HEADERS.  Try not to let this   confuse you.   These two are in the process of being merged, and eventually the   BFD_ASSEMBLER version should take over completely.  Release timing   issues and namespace problems convinced me to merge the two   together in this fashion, a little sooner than I would have liked.   The real merge should be much better done by the time the next   release comes out.   For now, the structure of this file is:	<common>	#ifdef BFD_ASSEMBLER	<one version>	#else	<other version>	#endif	<common>   Unfortunately, the common portions are very small at the moment,   and many declarations or definitions are duplicated.  The structure   of obj-coff.c is similar.   See doc/internals.texi for a brief discussion of the history, if   you care.   Ken Raeburn, 5 May 1994   *********************************************************************** */#ifdef BFD_ASSEMBLER#include "bfd/libcoff.h"#define OUTPUT_FLAVOR bfd_target_coff_flavour/* SYMBOL TABLE *//* Alter the field names, for now, until we've fixed up the other   references to use the new name.  */#ifdef TC_I960#define TC_SYMFIELD_TYPE	symbolS *#define sy_tc			bal#endif#define OBJ_SYMFIELD_TYPE	unsigned long#define sy_obj			sy_flags#define SYM_AUXENT(S) \  (&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent)#define SYM_AUXINFO(S) \  (&coffsymbol (symbol_get_bfdsym (S))->native[1])#define DO_NOT_STRIP	0extern void obj_coff_section PARAMS ((int));/* The number of auxiliary entries */#define S_GET_NUMBER_AUXILIARY(s) \  (coffsymbol (symbol_get_bfdsym (s))->native->u.syment.n_numaux)/* The number of auxiliary entries */#define S_SET_NUMBER_AUXILIARY(s,v)	(S_GET_NUMBER_AUXILIARY (s) = (v))/* True if a symbol name is in the string table, i.e. its length is > 8.  */#define S_IS_STRING(s)		(strlen(S_GET_NAME(s)) > 8 ? 1 : 0)extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int));extern int S_SET_STORAGE_CLASS PARAMS ((symbolS *, int));extern int S_GET_STORAGE_CLASS PARAMS ((symbolS *));extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *));/* Auxiliary entry macros. SA_ stands for symbol auxiliary *//* Omit the tv related fields *//* Accessors */#define SA_GET_SYM_TAGNDX(s)	(SYM_AUXENT (s)->x_sym.x_tagndx.l)#define SA_GET_SYM_LNNO(s)	(SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno)#define SA_GET_SYM_SIZE(s)	(SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size)#define SA_GET_SYM_FSIZE(s)	(SYM_AUXENT (s)->x_sym.x_misc.x_fsize)#define SA_GET_SYM_LNNOPTR(s)	(SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr)#define SA_GET_SYM_ENDNDX(s)	(SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_endndx)#define SA_GET_SYM_DIMEN(s,i)	(SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)])#define SA_GET_FILE_FNAME(s)	(SYM_AUXENT (s)->x_file.x_fname)#define SA_GET_SCN_SCNLEN(s)	(SYM_AUXENT (s)->x_scn.x_scnlen)#define SA_GET_SCN_NRELOC(s)	(SYM_AUXENT (s)->x_scn.x_nreloc)#define SA_GET_SCN_NLINNO(s)	(SYM_AUXENT (s)->x_scn.x_nlinno)#define SA_SET_SYM_LNNO(s,v)	(SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_lnno=(v))#define SA_SET_SYM_SIZE(s,v)	(SYM_AUXENT (s)->x_sym.x_misc.x_lnsz.x_size=(v))#define SA_SET_SYM_FSIZE(s,v)	(SYM_AUXENT (s)->x_sym.x_misc.x_fsize=(v))#define SA_SET_SYM_LNNOPTR(s,v)	(SYM_AUXENT (s)->x_sym.x_fcnary.x_fcn.x_lnnoptr=(v))#define SA_SET_SYM_DIMEN(s,i,v)	(SYM_AUXENT (s)->x_sym.x_fcnary.x_ary.x_dimen[(i)]=(v))#define SA_SET_FILE_FNAME(s,v)	strncpy(SYM_AUXENT (s)->x_file.x_fname,(v),FILNMLEN)#define SA_SET_SCN_SCNLEN(s,v)	(SYM_AUXENT (s)->x_scn.x_scnlen=(v))#define SA_SET_SCN_NRELOC(s,v)	(SYM_AUXENT (s)->x_scn.x_nreloc=(v))#define SA_SET_SCN_NLINNO(s,v)	(SYM_AUXENT (s)->x_scn.x_nlinno=(v))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?