| 1 | /* m88k.h -- Assembler for the Motorola 88000 | 
|---|
| 2 | Contributed by Devon Bowen of Buffalo University | 
|---|
| 3 | and Torbjorn Granlund of the Swedish Institute of Computer Science. | 
|---|
| 4 | Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, | 
|---|
| 5 | 2002 Free Software Foundation, Inc. | 
|---|
| 6 |  | 
|---|
| 7 | This file is part of GAS, the GNU Assembler. | 
|---|
| 8 |  | 
|---|
| 9 | GAS is free software; you can redistribute it and/or modify | 
|---|
| 10 | it under the terms of the GNU General Public License as published by | 
|---|
| 11 | the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 12 | any later version. | 
|---|
| 13 |  | 
|---|
| 14 | GAS is distributed in the hope that it will be useful, | 
|---|
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 17 | GNU General Public License for more details. | 
|---|
| 18 |  | 
|---|
| 19 | You should have received a copy of the GNU General Public License | 
|---|
| 20 | along with GAS; see the file COPYING.  If not, write to the Free | 
|---|
| 21 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | 
|---|
| 22 | 02111-1307, USA.  */ | 
|---|
| 23 |  | 
|---|
| 24 | #define TC_M88K | 
|---|
| 25 |  | 
|---|
| 26 | #define TARGET_BYTES_BIG_ENDIAN 1 | 
|---|
| 27 |  | 
|---|
| 28 | #ifdef M88KCOFF | 
|---|
| 29 | #define COFF_MAGIC MC88OMAGIC | 
|---|
| 30 | #define BFD_ARCH bfd_arch_m88k | 
|---|
| 31 | #define COFF_FLAGS F_AR32W | 
|---|
| 32 | #endif | 
|---|
| 33 |  | 
|---|
| 34 | #define NEED_FX_R_TYPE | 
|---|
| 35 | #define TC_KEEP_FX_OFFSET | 
|---|
| 36 | #define TC_CONS_RELOC RELOC_32 | 
|---|
| 37 |  | 
|---|
| 38 | /* different type of relocation available in the m88k */ | 
|---|
| 39 |  | 
|---|
| 40 | enum reloc_type | 
|---|
| 41 | { | 
|---|
| 42 | RELOC_LO16,                   /* lo16(sym) */ | 
|---|
| 43 | RELOC_HI16,                   /* hi16(sym) */ | 
|---|
| 44 | RELOC_PC16,                   /* bb0, bb1, bcnd */ | 
|---|
| 45 | RELOC_PC26,                   /* br, bsr */ | 
|---|
| 46 | RELOC_32,                     /* jump tables, etc */ | 
|---|
| 47 | RELOC_IW16,                   /* global access through linker regs 28 */ | 
|---|
| 48 | NO_RELOC | 
|---|
| 49 | }; | 
|---|
| 50 |  | 
|---|
| 51 | struct reloc_info_m88k | 
|---|
| 52 | { | 
|---|
| 53 | unsigned long int r_address; | 
|---|
| 54 | unsigned int r_symbolnum:24; | 
|---|
| 55 | unsigned int r_extern:1; | 
|---|
| 56 | unsigned int r_pad:3; | 
|---|
| 57 | enum reloc_type r_type:4; | 
|---|
| 58 | long int r_addend; | 
|---|
| 59 | }; | 
|---|
| 60 |  | 
|---|
| 61 | #define relocation_info reloc_info_m88k | 
|---|
| 62 |  | 
|---|
| 63 | /* The m88k uses '@' to start local labels.  */ | 
|---|
| 64 | #define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) | 
|---|
| 65 |  | 
|---|
| 66 | #ifndef BFD_ASSEMBLER | 
|---|
| 67 | #define LOCAL_LABEL(name) \ | 
|---|
| 68 | ((name[0] =='@' && (name [1] == 'L' || name [1] == '.')) \ | 
|---|
| 69 | || (name[0] == 'L' && name[1] == '0' && name[2] == '\001')) | 
|---|
| 70 | #endif | 
|---|
| 71 |  | 
|---|
| 72 | /* The m88k uses pseudo-ops with no leading period.  */ | 
|---|
| 73 | #define NO_PSEUDO_DOT 1 | 
|---|
| 74 |  | 
|---|
| 75 | /* Don't warn on word overflow; it happens on %hi relocs.  */ | 
|---|
| 76 | #undef WARN_SIGNED_OVERFLOW_WORD | 
|---|
| 77 |  | 
|---|
| 78 | #define md_convert_frag(b,s,f)          {as_fatal (_("m88k convert_frag\n"));} | 
|---|
| 79 |  | 
|---|
| 80 | /* We don't need to do anything special for undefined symbols.  */ | 
|---|
| 81 | #define md_undefined_symbol(s) 0 | 
|---|
| 82 |  | 
|---|
| 83 | /* We have no special operand handling.  */ | 
|---|
| 84 | #define md_operand(e) | 
|---|
| 85 |  | 
|---|
| 86 | #ifdef M88KCOFF | 
|---|
| 87 |  | 
|---|
| 88 | /* Whether a reloc should be output.  */ | 
|---|
| 89 | #define TC_COUNT_RELOC(fixp) ((fixp)->fx_addsy != NULL) | 
|---|
| 90 |  | 
|---|
| 91 | /* Get the BFD reloc type to use for a gas fixS structure.  */ | 
|---|
| 92 | #define TC_COFF_FIX2RTYPE(fixp) tc_coff_fix2rtype (fixp) | 
|---|
| 93 |  | 
|---|
| 94 | /* No special hook needed for symbols.  */ | 
|---|
| 95 | #define tc_coff_symbol_emit_hook(s) | 
|---|
| 96 |  | 
|---|
| 97 | /* Align sections to a four byte boundary.  */ | 
|---|
| 98 | #ifndef max | 
|---|
| 99 | #define max(a,b)        (((a) > (b)) ? (a) : (b)) | 
|---|
| 100 | #endif | 
|---|
| 101 | #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) max (section_alignment[(int) (SEG)], 4) | 
|---|
| 102 |  | 
|---|
| 103 | /* Fill in rs_align_code fragments.  */ | 
|---|
| 104 | extern void m88k_handle_align PARAMS ((fragS *)); | 
|---|
| 105 | #define HANDLE_ALIGN(frag)  m88k_handle_align (frag) | 
|---|
| 106 |  | 
|---|
| 107 | #define MAX_MEM_FOR_RS_ALIGN_CODE  (3 + 4) | 
|---|
| 108 |  | 
|---|
| 109 | #endif /* M88KCOFF */ | 
|---|