]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/config/tc-rl78.h
Copyright update for binutils
[thirdparty/binutils-gdb.git] / gas / config / tc-rl78.h
CommitLineData
99c513f6 1/* tc-rl78.h - header file for Renesas RL78
6f2750fe 2 Copyright (C) 2011-2016 Free Software Foundation, Inc.
99c513f6
DD
3
4 This file is part of GAS, the GNU Assembler.
5
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
19 02110-1301, USA. */
20
21#define TC_RL78
22
23extern int target_little_endian;
24
25#define LISTING_HEADER "RL78 GAS LE"
26#define LISTING_LHS_WIDTH 8
27#define LISTING_WORD_SIZE 1
28
29#define TARGET_ARCH bfd_arch_rl78
30
31#define TARGET_BYTES_BIG_ENDIAN 0
32
33#define TARGET_FORMAT "elf32-rl78"
34
35/* We don't need to handle .word strangely. */
36#define WORKING_DOT_WORD
37
38/* Permit temporary numeric labels. */
39#define LOCAL_LABELS_FB 1
40/* But make sure that the binutils treat them as locals. */
41#define LOCAL_LABEL_PREFIX '.'
42
43/* Allow classic-style constants. */
44#define NUMBERS_WITH_SUFFIX 1
45
46/* .-foo gets turned into PC relative relocs. */
47#define DIFF_EXPR_OK
48
49#define md_end rl78_md_end
50extern void rl78_md_end (void);
51
0c315784
DD
52#define md_relax_frag rl78_relax_frag
53extern int rl78_relax_frag (segT, fragS *, long);
54
99c513f6
DD
55#define TC_FRAG_TYPE struct rl78_bytesT *
56#define TC_FRAG_INIT rl78_frag_init
57extern void rl78_frag_init (fragS *);
58
59/* Call md_pcrel_from_section(), not md_pcrel_from(). */
60#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
61extern long md_pcrel_from_section (struct fix *, segT);
62
63/* RL78 doesn't have a 32 bit PCREL relocations. */
64#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1
65
66#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
67 rl78_validate_fix_sub (FIX)
68extern int rl78_validate_fix_sub (struct fix *);
69
00c06fdc 70#define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP, RET) \
99c513f6
DD
71 rl78_cons_fix_new (FRAG, WHERE, NBYTES, EXP)
72extern void rl78_cons_fix_new (fragS *, int, int, expressionS *);
73
74#define tc_fix_adjustable(x) 0
75
76#define RELOC_EXPANSION_POSSIBLE 1
77#define MAX_RELOC_EXPANSION 8
9cea966c
DD
78
79#define MAX_MEM_FOR_RS_ALIGN_CODE 8
80#define HANDLE_ALIGN(FRAG) rl78_handle_align (FRAG)
81extern void rl78_handle_align (fragS *);
4046d87a
NC
82
83#define elf_tc_final_processing rl78_elf_final_processing
84extern void rl78_elf_final_processing (void);
6d012254
NC
85
86#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
87 ((EXP)->X_md = 0, expression (EXP), TC_PARSE_CONS_RETURN_NONE)
6ff71e76
NC
88
89#define TC_LINKRELAX_FIXUP(seg) ((seg->flags & SEC_CODE) || (seg->flags & SEC_DEBUGGING))
90
91/* Do not adjust relocations involving symbols in code sections,
92 because it breaks linker relaxations. This could be fixed in the
93 linker, but this fix is simpler, and it pretty much only affects
94 object size a little bit. */
95#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
96 ( ((SEC)->flags & SEC_CODE) != 0 \
97 || ((SEC)->flags & SEC_DEBUGGING) != 0 \
98 || ! SEG_NORMAL (SEC) \
99 || TC_FORCE_RELOCATION (FIX))
100
101#define DWARF2_USE_FIXED_ADVANCE_PC 1
e896287c
DD
102
103#define TC_FORCE_RELOCATION(FIX) (linkrelax)