1 /* tc-cr16.h -- Header file for tc-cr16.c, the CR16 GAS port.
2 Copyright (C) 2007-2018 Free Software Foundation, Inc.
4 Contributed by M R Swami Reddy <MR.Swami.Reddy@nsc.com>
6 This file is part of GAS, the GNU Assembler.
8 GAS is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 GAS is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GAS; see the file COPYING. If not, write to the
20 Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
28 #define TARGET_BYTES_BIG_ENDIAN 0
30 #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
32 #define TARGET_FORMAT "elf32-cr16"
33 #define TARGET_ARCH bfd_arch_cr16
35 #define WORKING_DOT_WORD
36 #define LOCAL_LABEL_PREFIX '.'
38 #define md_number_to_chars number_to_chars_littleendian
40 /* We do relaxing in the assembler as well as the linker. */
41 extern const struct relax_type md_relax_table[];
42 #define TC_GENERIC_RELAX_TABLE md_relax_table
44 /* We do not want to adjust any relocations to make implementation of
45 linker relaxations easier. */
46 #define tc_fix_adjustable(fixP) 0
48 /* We need to force out some relocations when relaxing. */
49 #define TC_FORCE_RELOCATION(FIXP) cr16_force_relocation (FIXP)
50 extern int cr16_force_relocation (struct fix *);
52 /* Fixup non-code sections since we will never relax them. */
53 #define TC_LINKRELAX_FIXUP(seg) \
54 ((seg->flags & (SEC_ALLOC | SEC_CODE)) == (SEC_ALLOC | SEC_CODE))
56 /* CR16 instructions, with operands included, are a multiple
58 #define DWARF2_LINE_MIN_INSN_LENGTH 2
60 extern void cr16_cons_fix_new (struct frag *, int, int, struct expressionS *,
61 bfd_reloc_code_real_type);
62 /* This is called by emit_expr when creating a reloc for a cons.
63 We could use the definition there, except that we want to handle
64 the CR16 reloc type specially, rather than the BFD_RELOC type. */
65 #define TC_CONS_FIX_NEW(FRAG, OFF, LEN, EXP, RELOC) \
66 cr16_cons_fix_new (FRAG, OFF, LEN, EXP, RELOC)
68 /* Give an error if a frag containing code is not aligned to a 2-byte
70 #define md_frag_check(FRAGP) \
71 if ((FRAGP)->has_code \
72 && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \
73 as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \
74 _("instruction address is not a multiple of 2"));
76 #endif /* TC_CR16_H */