Back to index

cell-binutils  2.17cvs20070401
tc-spu.h
Go to the documentation of this file.
00001 /* spu.h -- Assembler for spu
00002 
00003    Copyright 2006, 2007 Free Software Foundation, Inc.
00004 
00005    This file is part of GAS, the GNU Assembler.
00006 
00007    GAS is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    GAS is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with GAS; see the file COPYING.  If not, write to the Free
00019    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00020    02110-1301, USA.  */
00021 
00022 #define TC_SPU
00023 
00024 #include "opcode/spu.h"
00025 
00026 #ifdef OBJ_ELF
00027 #define TARGET_FORMAT "elf32-spu"
00028 #define TARGET_ARCH bfd_arch_spu
00029 #define TARGET_NAME "elf32-spu"
00030 #endif
00031 
00032 #define TARGET_BYTES_BIG_ENDIAN 1
00033 
00034 #ifndef TARGET_NAME
00035 #define TARGET_NAME "coff-spu"
00036 #endif
00037 
00038 #ifndef TARGET_ARCH
00039 #define TARGET_ARCH bfd_arch_spu
00040 #endif
00041 
00042 #define COFF_MAGIC SPU_MAGIC
00043 #define BFD_ARCH bfd_arch_spu
00044 
00045 #define NEED_FX_R_TYPE
00046 #define TC_KEEP_FX_OFFSET
00047 /* #define TC_CONS_RELOC RELOC_32 */
00048 
00049 struct tc_fix_info {
00050   unsigned short arg_format;
00051   unsigned short insn_tag;
00052 };
00053 
00054 /* fixS will have a member named tc_fix_data of this type.  */
00055 #define TC_FIX_TYPE struct tc_fix_info
00056 #define TC_INIT_FIX_DATA(FIXP) \
00057   do                                      \
00058     {                                     \
00059       (FIXP)->tc_fix_data.arg_format = 0; \
00060       (FIXP)->tc_fix_data.insn_tag = 0;          \
00061     }                                     \
00062   while (0)
00063 
00064 /* Don't reduce function symbols to section symbols.  */
00065 #define tc_fix_adjustable(FIXP) (!S_IS_FUNCTION ((FIXP)->fx_addsy))
00066 
00067 /* Keep relocs on calls.  Branches to function symbols are tail or
00068    sibling calls.  */
00069 #define TC_FORCE_RELOCATION(FIXP) \
00070   ((FIXP)->tc_fix_data.insn_tag == M_BRSL        \
00071    || (FIXP)->tc_fix_data.insn_tag == M_BRASL           \
00072    || (((FIXP)->tc_fix_data.insn_tag == M_BR            \
00073        || (FIXP)->tc_fix_data.insn_tag == M_BRA) \
00074        && (FIXP)->fx_addsy != NULL               \
00075        && S_IS_FUNCTION ((FIXP)->fx_addsy))             \
00076    || generic_force_reloc (FIXP))
00077 
00078 /* Values passed to md_apply_fix don't include symbol values.  */
00079 #define MD_APPLY_SYM_VALUE(FIX) 0
00080 
00081 /* The spu uses pseudo-ops with no leading period.  */
00082 #define NO_PSEUDO_DOT 1
00083 
00084 /* Don't warn on word overflow; it happens on %hi relocs.  */
00085 #undef WARN_SIGNED_OVERFLOW_WORD
00086 
00087 #ifdef OBJ_ELF
00088 #define DIFF_EXPR_OK
00089 #endif
00090 
00091 #define WORKING_DOT_WORD
00092 
00093 #define md_number_to_chars number_to_chars_bigendian
00094 
00095 #define md_convert_frag(b,s,f)            {as_fatal (_("spu convert_frag\n"));}
00096 
00097 /* We don't need to do anything special for undefined symbols.  */
00098 #define md_undefined_symbol(s) 0
00099 
00100 /* We have no special operand handling.  */
00101 #define md_operand(e)
00102 
00103 /* Fill in rs_align_code fragments.  */
00104 extern void spu_handle_align PARAMS ((fragS *));
00105 #define HANDLE_ALIGN(frag)  spu_handle_align (frag)
00106 
00107 #define MAX_MEM_FOR_RS_ALIGN_CODE  (7 + 8)
00108 
00109 #ifdef SPUCOFF
00110 
00111 /* Whether a reloc should be output.  */
00112 #define TC_COUNT_RELOC(fixp) ((fixp)->fx_addsy != NULL || (fixp)->fx_subsy != NULL)
00113 
00114 /* Get the BFD reloc type to use for a gas fixS structure.  */
00115 #define TC_COFF_FIX2RTYPE(fixp) tc_coff_fix2rtype (fixp)
00116 
00117 /* No special hook needed for symbols.  */
00118 #define tc_coff_symbol_emit_hook(s)
00119 
00120 /* Align sections to a four byte boundary.  */
00121 #ifndef max
00122 #define max(a,b)     (((a) > (b)) ? (a) : (b))
00123 #endif
00124 #define SUB_SEGMENT_ALIGN(SEG)     max (section_alignment[(int) (SEG)], 4)
00125 
00126 #endif /* SPUCOFF */