xref: /openbsd-src/gnu/usr.bin/binutils-2.17/gas/config/tc-m32c.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* tc-m32c.h -- Header file for tc-m32c.c.
2*3d8817e4Smiod    Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3*3d8817e4Smiod 
4*3d8817e4Smiod    This file is part of GAS, the GNU Assembler.
5*3d8817e4Smiod 
6*3d8817e4Smiod    GAS is free software; you can redistribute it and/or modify
7*3d8817e4Smiod    it under the terms of the GNU General Public License as published by
8*3d8817e4Smiod    the Free Software Foundation; either version 2, or (at your option)
9*3d8817e4Smiod    any later version.
10*3d8817e4Smiod 
11*3d8817e4Smiod    GAS is distributed in the hope that it will be useful,
12*3d8817e4Smiod    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*3d8817e4Smiod    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*3d8817e4Smiod    GNU General Public License for more details.
15*3d8817e4Smiod 
16*3d8817e4Smiod    You should have received a copy of the GNU General Public License
17*3d8817e4Smiod    along with GAS; see the file COPYING.  If not, write to
18*3d8817e4Smiod    the Free Software Foundation, 59 Temple Place - Suite 330,
19*3d8817e4Smiod    Boston, MA 02111-1307, USA. */
20*3d8817e4Smiod 
21*3d8817e4Smiod #define TC_M32C
22*3d8817e4Smiod 
23*3d8817e4Smiod #define LISTING_HEADER "M16C/M32C GAS "
24*3d8817e4Smiod 
25*3d8817e4Smiod /* The target BFD architecture.  */
26*3d8817e4Smiod #define TARGET_ARCH bfd_arch_m32c
27*3d8817e4Smiod 
28*3d8817e4Smiod #define TARGET_FORMAT "elf32-m32c"
29*3d8817e4Smiod 
30*3d8817e4Smiod #define TARGET_BYTES_BIG_ENDIAN 1
31*3d8817e4Smiod 
32*3d8817e4Smiod #define md_end  m32c_md_end
33*3d8817e4Smiod extern void m32c_md_end (void);
34*3d8817e4Smiod 
35*3d8817e4Smiod #define md_start_line_hook m32c_start_line_hook
36*3d8817e4Smiod extern void m32c_start_line_hook (void);
37*3d8817e4Smiod 
38*3d8817e4Smiod /* call md_pcrel_from_section, not md_pcrel_from */
39*3d8817e4Smiod long md_pcrel_from_section PARAMS ((struct fix *, segT));
40*3d8817e4Smiod #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
41*3d8817e4Smiod 
42*3d8817e4Smiod /* Permit temporary numeric labels.  */
43*3d8817e4Smiod #define LOCAL_LABELS_FB 1
44*3d8817e4Smiod 
45*3d8817e4Smiod #define DIFF_EXPR_OK		/* .-foo gets turned into PC relative relocs */
46*3d8817e4Smiod 
47*3d8817e4Smiod /* We don't need to handle .word strangely.  */
48*3d8817e4Smiod #define WORKING_DOT_WORD
49*3d8817e4Smiod 
50*3d8817e4Smiod #define md_apply_fix m32c_apply_fix
51*3d8817e4Smiod extern void m32c_apply_fix PARAMS ((struct fix *, valueT *, segT));
52*3d8817e4Smiod 
53*3d8817e4Smiod #define tc_fix_adjustable(fixP) m32c_fix_adjustable (fixP)
54*3d8817e4Smiod extern bfd_boolean m32c_fix_adjustable PARAMS ((struct fix *));
55*3d8817e4Smiod 
56*3d8817e4Smiod /* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
57*3d8817e4Smiod #define TC_FORCE_RELOCATION(fix) m32c_force_relocation (fix)
58*3d8817e4Smiod extern int m32c_force_relocation PARAMS ((struct fix *));
59*3d8817e4Smiod 
60*3d8817e4Smiod extern const struct relax_type md_relax_table[];
61*3d8817e4Smiod #define TC_GENERIC_RELAX_TABLE md_relax_table
62*3d8817e4Smiod 
63*3d8817e4Smiod extern void m32c_prepare_relax_scan PARAMS ((fragS *, offsetT *, relax_substateT state));
64*3d8817e4Smiod #define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE) \
65*3d8817e4Smiod 	m32c_prepare_relax_scan(FRAGP, &AIM, STATE)
66*3d8817e4Smiod 
67*3d8817e4Smiod /* Values passed to md_apply_fix don't include the symbol value.  */
68*3d8817e4Smiod #define MD_APPLY_SYM_VALUE(FIX) 0
69*3d8817e4Smiod 
70*3d8817e4Smiod /* Call md_pcrel_from_section(), not md_pcrel_from().  */
71*3d8817e4Smiod #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
72*3d8817e4Smiod extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
73*3d8817e4Smiod 
74*3d8817e4Smiod /* We need a special version of the TC_START_LABEL macro so that we
75*3d8817e4Smiod    allow the :Z, :S, :Q and :G suffixes to be
76*3d8817e4Smiod    parsed as such.  Note - in a HORRIBLE HACK, we make use of the
77*3d8817e4Smiod    knowledge that this marco is only ever evaluated in one place
78*3d8817e4Smiod    (read_a_source_file in read.c) where we can access the local
79*3d8817e4Smiod    variable 's' - the start of the symbol that was terminated by
80*3d8817e4Smiod    'character'.  Also we need to be able to change the contents of
81*3d8817e4Smiod    the local variable 'c' which is passed to this macro as 'character'.  */
82*3d8817e4Smiod #define TC_START_LABEL(character, i_l_p)			\
83*3d8817e4Smiod   ((character) != ':' ? 0 : (character = m32c_is_colon_insn (s)) ? 0 : ((character = ':'), 1))
84*3d8817e4Smiod extern char m32c_is_colon_insn PARAMS ((char *));
85