v850.h revision 302408
133965Sjdp/* V850 ELF support for BFD.
2218822Sdim   Copyright 1997, 1998, 2000, 2002, 2003, 2004, 2007
3218822Sdim   Free Software Foundation, Inc.
433965Sjdp   Created by Michael Meissner, Cygnus Support <meissner@cygnus.com>
533965Sjdp
6104834Sobrien   This file is part of BFD, the Binary File Descriptor library.
733965Sjdp
8104834Sobrien   This program is free software; you can redistribute it and/or modify
9104834Sobrien   it under the terms of the GNU General Public License as published by
10104834Sobrien   the Free Software Foundation; either version 2 of the License, or
11104834Sobrien   (at your option) any later version.
1233965Sjdp
13104834Sobrien   This program is distributed in the hope that it will be useful,
14104834Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
15104834Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16104834Sobrien   GNU General Public License for more details.
1733965Sjdp
18104834Sobrien   You should have received a copy of the GNU General Public License
19104834Sobrien   along with this program; if not, write to the Free Software
20218822Sdim   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2133965Sjdp
2233965Sjdp/* This file holds definitions specific to the MIPS ELF ABI.  Note
2333965Sjdp   that most of this is not actually implemented by BFD.  */
2433965Sjdp
2533965Sjdp#ifndef _ELF_V850_H
2633965Sjdp#define _ELF_V850_H
2733965Sjdp
2833965Sjdp/* Processor specific flags for the ELF header e_flags field.  */
2933965Sjdp
3033965Sjdp/* Four bit V850 architecture field.  */
3133965Sjdp#define EF_V850_ARCH		0xf0000000
3233965Sjdp
3333965Sjdp/* v850 code.  */
3433965Sjdp#define E_V850_ARCH		0x00000000
3533965Sjdp
3633965Sjdp/* v850e code.  */
3733965Sjdp#define E_V850E_ARCH		0x10000000
3889857Sobrien
3989857Sobrien/* v850e1 code.  */
4033965Sjdp#define E_V850E1_ARCH		0x20000000
4133965Sjdp
4233965Sjdp
4333965Sjdp/* Flags for the st_other field.  */
4489857Sobrien#define V850_OTHER_SDA		0x10	/* Symbol had SDA relocations.  */
4589857Sobrien#define V850_OTHER_ZDA		0x20	/* Symbol had ZDA relocations.  */
4689857Sobrien#define V850_OTHER_TDA		0x40	/* Symbol had TDA relocations.  */
4789857Sobrien#define V850_OTHER_ERROR	0x80	/* Symbol had an error reported.  */
4889857Sobrien
4989857Sobrien/* V850 relocations.  */
5089857Sobrien#include "elf/reloc-macros.h"
5189857Sobrien
5289857SobrienSTART_RELOC_NUMBERS (v850_reloc_type)
5333965Sjdp     RELOC_NUMBER (R_V850_NONE, 0)
5433965Sjdp     RELOC_NUMBER (R_V850_9_PCREL, 1)
5533965Sjdp     RELOC_NUMBER (R_V850_22_PCREL, 2)
5633965Sjdp     RELOC_NUMBER (R_V850_HI16_S, 3)
5733965Sjdp     RELOC_NUMBER (R_V850_HI16, 4)
5833965Sjdp     RELOC_NUMBER (R_V850_LO16, 5)
5933965Sjdp     RELOC_NUMBER (R_V850_ABS32, 6)
6033965Sjdp     RELOC_NUMBER (R_V850_16, 7)
6133965Sjdp     RELOC_NUMBER (R_V850_8, 8)
6233965Sjdp     RELOC_NUMBER( R_V850_SDA_16_16_OFFSET, 9)		/* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
6333965Sjdp     RELOC_NUMBER( R_V850_SDA_15_16_OFFSET, 10)		/* For ld.w, ld.h, ld.hu, st.w, st.h */
6433965Sjdp     RELOC_NUMBER( R_V850_ZDA_16_16_OFFSET, 11)		/* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
6533965Sjdp     RELOC_NUMBER( R_V850_ZDA_15_16_OFFSET, 12)		/* For ld.w, ld.h, ld.hu, st.w, st.h */
6633965Sjdp     RELOC_NUMBER( R_V850_TDA_6_8_OFFSET, 13)		/* For sst.w, sld.w */
6733965Sjdp     RELOC_NUMBER( R_V850_TDA_7_8_OFFSET, 14)		/* For sst.h, sld.h */
6833965Sjdp     RELOC_NUMBER( R_V850_TDA_7_7_OFFSET, 15)		/* For sst.b, sld.b */
69130561Sobrien     RELOC_NUMBER( R_V850_TDA_16_16_OFFSET, 16)		/* For set1, clr1, not1, tst1, movea, movhi */
70130561Sobrien     RELOC_NUMBER( R_V850_TDA_4_5_OFFSET, 17)		/* For sld.hu */
71130561Sobrien     RELOC_NUMBER( R_V850_TDA_4_4_OFFSET, 18)		/* For sld.bu */
72130561Sobrien     RELOC_NUMBER( R_V850_SDA_16_16_SPLIT_OFFSET, 19)	/* For ld.bu */
73130561Sobrien     RELOC_NUMBER( R_V850_ZDA_16_16_SPLIT_OFFSET, 20)	/* For ld.bu */
74130561Sobrien     RELOC_NUMBER( R_V850_CALLT_6_7_OFFSET, 21)		/* For callt */
75130561Sobrien     RELOC_NUMBER( R_V850_CALLT_16_16_OFFSET, 22)	/* For callt */
76130561Sobrien     RELOC_NUMBER (R_V850_GNU_VTINHERIT, 23)
7733965Sjdp     RELOC_NUMBER (R_V850_GNU_VTENTRY, 24)
7833965Sjdp     RELOC_NUMBER (R_V850_LONGCALL, 25)
7933965Sjdp     RELOC_NUMBER (R_V850_LONGJUMP, 26)
8033965Sjdp     RELOC_NUMBER (R_V850_ALIGN, 27)
8133965Sjdp     RELOC_NUMBER (R_V850_REL32, 28)
8233965Sjdp     RELOC_NUMBER (R_V850_LO16_SPLIT_OFFSET, 29)	/* For ld.bu */
8333965SjdpEND_RELOC_NUMBERS (R_V850_max)
84130561Sobrien
8533965Sjdp
8633965Sjdp/* Processor specific section indices.  These sections do not actually
8733965Sjdp   exist.  Symbols with a st_shndx field corresponding to one of these
8833965Sjdp   values have a special meaning.  */
8933965Sjdp
9033965Sjdp/* Small data area common symbol.  */
9133965Sjdp#define SHN_V850_SCOMMON	0xff00
9233965Sjdp
9333965Sjdp/* Tiny data area common symbol.  */
9433965Sjdp#define SHN_V850_TCOMMON	0xff01
95218822Sdim
96218822Sdim/* Zero data area common symbol.  */
97218822Sdim#define SHN_V850_ZCOMMON	0xff02
98218822Sdim
99218822Sdim
100218822Sdim/* Processor specific section types.  */
101218822Sdim
102218822Sdim/* Section contains the .scommon data.  */
103218822Sdim#define SHT_V850_SCOMMON	0x70000000
104218822Sdim
105218822Sdim/* Section contains the .scommon data.  */
106218822Sdim#define SHT_V850_TCOMMON	0x70000001
107218822Sdim
108218822Sdim/* Section contains the .scommon data.  */
109218822Sdim#define SHT_V850_ZCOMMON	0x70000002
110218822Sdim
111218822Sdim/* Processor specific section flags.  */
112218822Sdim
113218822Sdim/* This section must be in the small data area (pointed to by GP).  */
114218822Sdim#define SHF_V850_GPREL		0x10000000
11533965Sjdp
116218822Sdim/* This section must be in the tiny data area (pointed to by EP).  */
11733965Sjdp#define SHF_V850_EPREL		0x20000000
11833965Sjdp
11933965Sjdp/* This section must be in the zero data area (pointed to by R0).  */
12033965Sjdp#define SHF_V850_R0REL		0x40000000
121218822Sdim
122218822Sdim#endif /* _ELF_V850_H */
12333965Sjdp