Back to index

cell-binutils  2.17cvs20070401
tc-avr.h
Go to the documentation of this file.
00001 /* This file is tc-avr.h
00002    Copyright 1999, 2000, 2001, 2002, 2005, 2006, 2007
00003    Free Software Foundation, Inc.
00004 
00005    Contributed by Denis Chertykov <denisc@overta.ru>
00006 
00007    This file is part of GAS, the GNU Assembler.
00008 
00009    GAS is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 2, or (at your option)
00012    any later version.
00013 
00014    GAS is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018 
00019    You should have received a copy of the GNU General Public License
00020    along with GAS; see the file COPYING.  If not, write to the Free
00021    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00022    02110-1301, USA.  */
00023 
00024 /* By convention, you should define this macro in the `.h' file.  For
00025    example, `tc-m68k.h' defines `TC_M68K'.  You might have to use this
00026    if it is necessary to add CPU specific code to the object format
00027    file.  */
00028 #define TC_AVR
00029 
00030 /* This macro is the BFD target name to use when creating the output
00031    file.  This will normally depend upon the `OBJ_FMT' macro.  */
00032 #define TARGET_FORMAT "elf32-avr"
00033 
00034 /* This macro is the BFD architecture to pass to `bfd_set_arch_mach'.  */
00035 #define TARGET_ARCH bfd_arch_avr
00036 
00037 /* This macro is the BFD machine number to pass to
00038    `bfd_set_arch_mach'.  If it is not defined, GAS will use 0.  */
00039 #define TARGET_MACH 0
00040 
00041 /* You should define this macro to be non-zero if the target is big
00042    endian, and zero if the target is little endian.  */
00043 #define TARGET_BYTES_BIG_ENDIAN 0
00044 
00045 /* If you define this macro, GAS will warn about the use of
00046    nonstandard escape sequences in a string.  */
00047 #define ONLY_STANDARD_ESCAPES
00048 
00049 /* GAS will call this function for any expression that can not be
00050    recognized.  When the function is called, `input_line_pointer'
00051    will point to the start of the expression.  */
00052 #define md_operand(x)
00053 
00054 /* You may define this macro to parse an expression used in a data
00055    allocation pseudo-op such as `.word'.  You can use this to
00056    recognize relocation directives that may appear in such directives.  */
00057 #define TC_PARSE_CONS_EXPRESSION(EXPR,N) avr_parse_cons_expression (EXPR, N)
00058 extern void avr_parse_cons_expression (expressionS *, int);
00059 
00060 /* You may define this macro to generate a fixup for a data
00061    allocation pseudo-op.  */
00062 #define TC_CONS_FIX_NEW(FRAG,WHERE,N,EXP) avr_cons_fix_new (FRAG, WHERE, N, EXP)
00063 extern void avr_cons_fix_new (fragS *,int, int, expressionS *);
00064 
00065 /* This should just call either `number_to_chars_bigendian' or
00066    `number_to_chars_littleendian', whichever is appropriate.  On
00067    targets like the MIPS which support options to change the
00068    endianness, which function to call is a runtime decision.  On
00069    other targets, `md_number_to_chars' can be a simple macro.  */
00070 #define md_number_to_chars number_to_chars_littleendian
00071 
00072 /* `md_short_jump_size'
00073    `md_long_jump_size'
00074    `md_create_short_jump'
00075    `md_create_long_jump'
00076    If `WORKING_DOT_WORD' is defined, GAS will not do broken word
00077    processing (*note Broken words::.).  Otherwise, you should set
00078    `md_short_jump_size' to the size of a short jump (a jump that is
00079    just long enough to jump around a long jmp) and
00080    `md_long_jump_size' to the size of a long jump (a jump that can go
00081    anywhere in the function), You should define
00082    `md_create_short_jump' to create a short jump around a long jump,
00083    and define `md_create_long_jump' to create a long jump.  */
00084 #define WORKING_DOT_WORD
00085 
00086 /* If you define this macro, it means that `tc_gen_reloc' may return
00087    multiple relocation entries for a single fixup.  In this case, the
00088    return value of `tc_gen_reloc' is a pointer to a null terminated
00089    array.  */
00090 #undef RELOC_EXPANSION_POSSIBLE
00091 
00092 /* No shared lib support, so we don't need to ensure externally
00093    visible symbols can be overridden.  */
00094 #define EXTERN_FORCE_RELOC 0
00095 
00096 /* Values passed to md_apply_fix don't include the symbol value.  */
00097 #define MD_APPLY_SYM_VALUE(FIX) 0
00098 
00099 /* If you define this macro, it should return the offset between the
00100    address of a PC relative fixup and the position from which the PC
00101    relative adjustment should be made.  On many processors, the base
00102    of a PC relative instruction is the next instruction, so this
00103    macro would return the length of an instruction.  */
00104 #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
00105 extern long md_pcrel_from_section (struct fix *, segT);
00106 
00107 /* The number of bytes to put into a word in a listing.  This affects
00108    the way the bytes are clumped together in the listing.  For
00109    example, a value of 2 might print `1234 5678' where a value of 1
00110    would print `12 34 56 78'.  The default value is 4.  */
00111 #define LISTING_WORD_SIZE 2
00112 
00113 /* AVR port uses `$' as a logical line separator.  */
00114 #define LEX_DOLLAR 0
00115 
00116 /* An `.lcomm' directive with no explicit alignment parameter will
00117    use this macro to set P2VAR to the alignment that a request for
00118    SIZE bytes will have.  The alignment is expressed as a power of
00119    two.  If no alignment should take place, the macro definition
00120    should do nothing.  Some targets define a `.bss' directive that is
00121    also affected by this macro.  The default definition will set
00122    P2VAR to the truncated power of two of sizes up to eight bytes.  */
00123 #define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 0
00124 
00125 /* We don't want gas to fixup the following program memory related relocations.
00126    We will need them in case that we want to do linker relaxation.
00127    We could in principle keep these fixups in gas when not relaxing.
00128    However, there is no serious performance penilty when making the linker
00129    make the fixup work.  Check also that fx_addsy is not NULL, in order to make
00130    sure that the fixup refers to some sort of lable.  */
00131 #define TC_VALIDATE_FIX(FIXP,SEG,SKIP)                       \
00132   if (   (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL           \
00133        || FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL          \
00134        || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM        \
00135        || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_GS        \
00136        || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM        \
00137        || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_GS        \
00138        || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM        \
00139        || FIXP->fx_r_type == BFD_RELOC_AVR_LO8_LDI_PM_NEG    \
00140        || FIXP->fx_r_type == BFD_RELOC_AVR_HI8_LDI_PM_NEG    \
00141        || FIXP->fx_r_type == BFD_RELOC_AVR_HH8_LDI_PM_NEG    \
00142        || FIXP->fx_r_type == BFD_RELOC_AVR_16_PM)            \
00143       && (FIXP->fx_addsy))                             \
00144     {                                                        \
00145       goto SKIP;                                             \
00146    }
00147 
00148 /* This target is buggy, and sets fix size too large.  */
00149 #define TC_FX_SIZE_SLACK(FIX) 2