| 1 | /* tc-i370.h -- Header file for tc-i370.c. |
| 2 | Copyright (C) 1994, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. |
| 3 | Written by Ian Lance Taylor, Cygnus Support. |
| 4 | |
| 5 | This file is part of GAS, the GNU Assembler. |
| 6 | |
| 7 | GAS is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2, or (at your option) |
| 10 | any later version. |
| 11 | |
| 12 | GAS is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with GAS; see the file COPYING. If not, write to the Free |
| 19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
| 20 | 02111-1307, USA. */ |
| 21 | |
| 22 | #define TC_I370 |
| 23 | |
| 24 | #ifdef ANSI_PROTOTYPES |
| 25 | struct fix; |
| 26 | #endif |
| 27 | |
| 28 | /* Set the endianness we are using. Default to big endian. */ |
| 29 | #ifndef TARGET_BYTES_BIG_ENDIAN |
| 30 | #define TARGET_BYTES_BIG_ENDIAN 1 |
| 31 | #endif |
| 32 | |
| 33 | #ifndef BFD_ASSEMBLER |
| 34 | #error I370 support requires BFD_ASSEMBLER |
| 35 | #endif |
| 36 | |
| 37 | /* The target BFD architecture. */ |
| 38 | #define TARGET_ARCH (i370_arch ()) |
| 39 | extern enum bfd_architecture i370_arch PARAMS ((void)); |
| 40 | |
| 41 | /* Whether or not the target is big endian */ |
| 42 | extern int target_big_endian; |
| 43 | |
| 44 | /* The target BFD format. */ |
| 45 | #ifdef OBJ_ELF |
| 46 | #define TARGET_FORMAT ("elf32-i370") |
| 47 | #endif |
| 48 | |
| 49 | /* Permit temporary numeric labels. */ |
| 50 | #define LOCAL_LABELS_FB 1 |
| 51 | |
| 52 | /* $ is used to refer to the current location. */ |
| 53 | /* #define DOLLAR_DOT */ |
| 54 | |
| 55 | #ifdef OBJ_ELF |
| 56 | #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ |
| 57 | #endif |
| 58 | |
| 59 | /* We don't need to handle .word strangely. */ |
| 60 | #define WORKING_DOT_WORD |
| 61 | |
| 62 | /* We set the fx_done field appropriately in md_apply_fix. */ |
| 63 | #define TC_HANDLES_FX_DONE |
| 64 | \f |
| 65 | |
| 66 | #ifdef OBJ_ELF |
| 67 | |
| 68 | /* Branch prediction relocations must force relocation. */ |
| 69 | #define TC_FORCE_RELOCATION_SECTION(FIXP,SEC) 1 |
| 70 | |
| 71 | /* Support for SHF_EXCLUDE and SHT_ORDERED */ |
| 72 | extern int i370_section_letter PARAMS ((int, char **)); |
| 73 | extern int i370_section_type PARAMS ((char *, size_t)); |
| 74 | extern int i370_section_word PARAMS ((char *, size_t)); |
| 75 | extern int i370_section_flags PARAMS ((int, int, int)); |
| 76 | |
| 77 | #define md_elf_section_letter(LETTER, PTR_MSG) i370_section_letter (LETTER, PTR_MSG) |
| 78 | #define md_elf_section_type(STR, LEN) i370_section_type (STR, LEN) |
| 79 | #define md_elf_section_word(STR, LEN) i370_section_word (STR, LEN) |
| 80 | #define md_elf_section_flags(FLAGS, ATTR, TYPE) i370_section_flags (FLAGS, ATTR, TYPE) |
| 81 | |
| 82 | #define tc_comment_chars i370_comment_chars |
| 83 | extern const char *i370_comment_chars; |
| 84 | |
| 85 | /* We must never ever try to resolve references to externally visible |
| 86 | symbols in the assembler, because the .o file might go into a shared |
| 87 | library, and some other shared library might override that symbol. */ |
| 88 | #define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ |
| 89 | ((FIX)->fx_addsy == NULL \ |
| 90 | || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ |
| 91 | && ! S_IS_WEAK ((FIX)->fx_addsy) \ |
| 92 | && S_IS_DEFINED ((FIX)->fx_addsy) \ |
| 93 | && ! S_IS_COMMON ((FIX)->fx_addsy))) |
| 94 | |
| 95 | #endif /* OBJ_ELF */ |
| 96 | |
| 97 | /* call md_apply_fix3 with segment instead of md_apply_fix */ |
| 98 | #define MD_APPLY_FIX3 |
| 99 | |
| 100 | /* call md_pcrel_from_section, not md_pcrel_from */ |
| 101 | #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) |
| 102 | extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); |
| 103 | |
| 104 | #define md_operand(x) |