Back to index

cell-binutils  2.17cvs20070401
arm.h
Go to the documentation of this file.
00001 /* ARM COFF support for BFD.
00002    Copyright 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
00003 
00004    This file is part of BFD, the Binary File Descriptor library.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software Foundation,
00018    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 #define COFFARM 1
00021 
00022 #define L_LNNO_SIZE 2
00023 #define INCLUDE_COMDAT_FIELDS_IN_AUXENT
00024 #include "coff/external.h"
00025 
00026 /* Bits for f_flags:
00027        F_RELFLG      relocation info stripped from file
00028        F_EXEC        file is executable (no unresolved external references)
00029        F_LNNO        line numbers stripped from file
00030        F_LSYMS              local symbols stripped from file
00031         F_INTERWORK     file supports switching between ARM and Thumb instruction sets
00032         F_INTERWORK_SET the F_INTERWORK bit is valid
00033        F_APCS_FLOAT  code passes float arguments in float registers
00034        F_PIC         code is reentrant/position-independent
00035        F_AR32WR      file has byte ordering of an AR32WR machine (e.g. vax)
00036        F_APCS_26     file uses 26 bit ARM Procedure Calling Standard
00037        F_APCS_SET    the F_APCS_26, F_APCS_FLOAT and F_PIC bits have been initialised
00038        F_SOFT_FLOAT  code does not use floating point instructions.  */
00039 
00040 #define F_RELFLG     (0x0001)
00041 #define F_EXEC              (0x0002)
00042 #define F_LNNO              (0x0004)
00043 #define F_LSYMS             (0x0008)
00044 #define F_INTERWORK  (0x0010)
00045 #define F_INTERWORK_SET     (0x0020)
00046 #define F_APCS_FLOAT (0x0040)
00047 #undef  F_AR16WR
00048 #define F_PIC        (0x0080)
00049 #define       F_AR32WR      (0x0100)
00050 #define F_APCS_26    (0x0400)
00051 #define F_APCS_SET   (0x0800)
00052 #define F_SOFT_FLOAT (0x2000)
00053 #define F_VFP_FLOAT  (0x4000)
00054 
00055 /* Bits stored in flags field of the internal_f structure */
00056 
00057 #define F_INTERWORK  (0x0010)
00058 #define F_APCS_FLOAT (0x0040)
00059 #define F_PIC        (0x0080)
00060 #define F_APCS26     (0x1000)
00061 #define F_ARM_ARCHITECTURE_MASK (0x4000+0x0800+0x0400)
00062 #define F_ARM_2             (0x0400)
00063 #define F_ARM_2a     (0x0800)
00064 #define F_ARM_3             (0x0c00)
00065 #define F_ARM_3M     (0x4000)
00066 #define F_ARM_4             (0x4400)
00067 #define F_ARM_4T     (0x4800)
00068 #define F_ARM_5             (0x4c00)
00069 
00070 /*
00071   ARMMAGIC ought to encoded the procesor type,
00072   but it is too late to change it now, instead
00073   the flags field of the internal_f structure
00074   is used as shown above.
00075  
00076   XXX - NC 5/6/97.  */
00077 
00078 #define       ARMMAGIC      0xa00  /* I just made this up */
00079 
00080 #define ARMBADMAG(x) (((x).f_magic != ARMMAGIC))
00081 
00082 #define       ARMPEMAGIC    0x1c0
00083 #define       THUMBPEMAGIC  0x1c2
00084 
00085 #undef  ARMBADMAG
00086 #define ARMBADMAG(x) (((x).f_magic != ARMMAGIC) && ((x).f_magic != ARMPEMAGIC) && ((x).f_magic != THUMBPEMAGIC))
00087 
00088 #define OMAGIC          0404    /* object files, eg as output */
00089 #define ZMAGIC          0413    /* demand load format, eg normal ld output */
00090 #define STMAGIC             0401   /* target shlib */
00091 #define SHMAGIC             0443   /* host   shlib */
00092 
00093 /* define some NT default values */
00094 /*  #define NT_IMAGE_BASE        0x400000 moved to internal.h */
00095 #define NT_SECTION_ALIGNMENT 0x1000
00096 #define NT_FILE_ALIGNMENT    0x200  
00097 #define NT_DEF_RESERVE       0x100000
00098 #define NT_DEF_COMMIT        0x1000
00099 
00100 /* We use the .rdata section to hold read only data.  */
00101 #define _LIT  ".rdata"
00102 
00103 /********************** RELOCATION DIRECTIVES **********************/
00104 #ifdef ARM_WINCE
00105 struct external_reloc
00106 {
00107   char r_vaddr[4];
00108   char r_symndx[4];
00109   char r_type[2];
00110 };
00111 
00112 #define RELOC struct external_reloc
00113 #define RELSZ 10
00114 
00115 #else
00116 struct external_reloc
00117 {
00118   char r_vaddr[4];
00119   char r_symndx[4];
00120   char r_type[2];
00121   char r_offset[4];
00122 };
00123 
00124 #define RELOC struct external_reloc
00125 #define RELSZ 14
00126 #endif
00127 
00128 #define ARM_NOTE_SECTION ".note"