Home | History | Annotate | Line # | Download | only in elf
      1   1.1  christos /* FRV ELF support for BFD.
      2  1.10  christos    Copyright (C) 2002-2025 Free Software Foundation, Inc.
      3   1.1  christos 
      4   1.1  christos    This file is part of BFD, the Binary File Descriptor library.
      5   1.1  christos 
      6   1.1  christos    This program is free software; you can redistribute it and/or modify
      7   1.1  christos    it under the terms of the GNU General Public License as published by
      8   1.1  christos    the Free Software Foundation; either version 3 of the License, or
      9   1.1  christos    (at your option) any later version.
     10   1.1  christos 
     11   1.1  christos    This program is distributed in the hope that it will be useful,
     12   1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     13   1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14   1.1  christos    GNU General Public License for more details.
     15   1.1  christos 
     16   1.1  christos    You should have received a copy of the GNU General Public License
     17   1.1  christos    along with this program; if not, write to the Free Software Foundation,
     18   1.1  christos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
     19   1.1  christos 
     20   1.1  christos #ifndef _ELF_FRV_H
     21   1.1  christos #define _ELF_FRV_H
     22   1.1  christos 
     23   1.1  christos #include "elf/reloc-macros.h"
     24   1.1  christos 
     25   1.1  christos /* Relocations.  */
     26   1.1  christos START_RELOC_NUMBERS (elf_frv_reloc_type)
     27   1.1  christos   RELOC_NUMBER (R_FRV_NONE, 0)
     28   1.1  christos   RELOC_NUMBER (R_FRV_32, 1)
     29   1.1  christos   RELOC_NUMBER (R_FRV_LABEL16, 2)
     30   1.1  christos   RELOC_NUMBER (R_FRV_LABEL24, 3)
     31   1.1  christos   RELOC_NUMBER (R_FRV_LO16, 4)
     32   1.1  christos   RELOC_NUMBER (R_FRV_HI16, 5)
     33   1.1  christos   RELOC_NUMBER (R_FRV_GPREL12, 6)
     34   1.1  christos   RELOC_NUMBER (R_FRV_GPRELU12, 7)
     35   1.1  christos   RELOC_NUMBER (R_FRV_GPREL32, 8)
     36   1.1  christos   RELOC_NUMBER (R_FRV_GPRELHI, 9)
     37   1.1  christos   RELOC_NUMBER (R_FRV_GPRELLO, 10)
     38   1.1  christos   RELOC_NUMBER (R_FRV_GOT12, 11)
     39   1.1  christos   RELOC_NUMBER (R_FRV_GOTHI, 12)
     40   1.1  christos   RELOC_NUMBER (R_FRV_GOTLO, 13)
     41   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC, 14)
     42   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOT12, 15)
     43   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOTHI, 16)
     44   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOTLO, 17)
     45   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_VALUE, 18)
     46   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFF12, 19)
     47   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFFHI, 20)
     48   1.1  christos   RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFFLO, 21)
     49   1.1  christos   RELOC_NUMBER (R_FRV_GOTOFF12, 22)
     50   1.1  christos   RELOC_NUMBER (R_FRV_GOTOFFHI, 23)
     51   1.1  christos   RELOC_NUMBER (R_FRV_GOTOFFLO, 24)
     52   1.1  christos   RELOC_NUMBER (R_FRV_GETTLSOFF, 25)
     53   1.1  christos   RELOC_NUMBER (R_FRV_TLSDESC_VALUE, 26)
     54   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSDESC12, 27)
     55   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSDESCHI, 28)
     56   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSDESCLO, 29)
     57   1.1  christos   RELOC_NUMBER (R_FRV_TLSMOFF12, 30)
     58   1.1  christos   RELOC_NUMBER (R_FRV_TLSMOFFHI, 31)
     59   1.1  christos   RELOC_NUMBER (R_FRV_TLSMOFFLO, 32)
     60   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSOFF12, 33)
     61   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSOFFHI, 34)
     62   1.1  christos   RELOC_NUMBER (R_FRV_GOTTLSOFFLO, 35)
     63   1.1  christos   RELOC_NUMBER (R_FRV_TLSOFF, 36)
     64   1.1  christos   RELOC_NUMBER (R_FRV_TLSDESC_RELAX, 37)
     65   1.1  christos   RELOC_NUMBER (R_FRV_GETTLSOFF_RELAX, 38)
     66   1.1  christos   RELOC_NUMBER (R_FRV_TLSOFF_RELAX, 39)
     67   1.1  christos   RELOC_NUMBER (R_FRV_TLSMOFF, 40)
     68   1.1  christos   RELOC_NUMBER (R_FRV_GNU_VTINHERIT, 200)
     69   1.1  christos   RELOC_NUMBER (R_FRV_GNU_VTENTRY, 201)
     70   1.1  christos END_RELOC_NUMBERS(R_FRV_max)
     71   1.1  christos 
     72   1.1  christos /* Processor specific flags for the ELF header e_flags field.  */
     73   1.1  christos 						/* gpr support */
     74   1.1  christos #define EF_FRV_GPR_MASK		0x00000003	/* mask for # of gprs */
     75   1.1  christos #define EF_FRV_GPR_32		0x00000001	/* -mgpr-32 */
     76   1.1  christos #define EF_FRV_GPR_64		0x00000002	/* -mgpr-64 */
     77   1.1  christos 
     78   1.1  christos 						/* fpr support */
     79   1.1  christos #define EF_FRV_FPR_MASK		0x0000000c	/* mask for # of fprs */
     80   1.1  christos #define EF_FRV_FPR_32		0x00000004	/* -mfpr-32 */
     81   1.1  christos #define EF_FRV_FPR_64		0x00000008	/* -mfpr-64 */
     82   1.1  christos #define EF_FRV_FPR_NONE		0x0000000c	/* -msoft-float */
     83   1.1  christos 
     84   1.1  christos 						/* double word support */
     85   1.1  christos #define EF_FRV_DWORD_MASK	0x00000030	/* mask for dword support */
     86   1.1  christos #define EF_FRV_DWORD_YES	0x00000010	/* use double word insns */
     87   1.1  christos #define EF_FRV_DWORD_NO		0x00000020	/* don't use double word insn*/
     88   1.1  christos 
     89   1.1  christos #define EF_FRV_DOUBLE		0x00000040	/* -mdouble */
     90   1.1  christos #define EF_FRV_MEDIA		0x00000080	/* -mmedia */
     91   1.1  christos 
     92   1.1  christos #define EF_FRV_PIC		0x00000100	/* -fpic */
     93   1.1  christos #define EF_FRV_NON_PIC_RELOCS	0x00000200	/* used non pic safe relocs */
     94   1.1  christos 
     95   1.1  christos #define EF_FRV_MULADD		0x00000400	/* -mmuladd */
     96   1.1  christos #define EF_FRV_BIGPIC		0x00000800	/* -fPIC */
     97   1.1  christos #define	EF_FRV_LIBPIC		0x00001000	/* -mlibrary-pic */
     98   1.1  christos #define EF_FRV_G0		0x00002000	/* -G 0, no small data ptr */
     99   1.1  christos #define EF_FRV_NOPACK		0x00004000	/* -mnopack */
    100   1.1  christos #define EF_FRV_FDPIC		0x00008000      /* -mfdpic */
    101   1.1  christos 
    102   1.1  christos #define	EF_FRV_CPU_MASK		0xff000000	/* specific cpu bits */
    103   1.1  christos #define EF_FRV_CPU_GENERIC	0x00000000	/* generic FRV */
    104   1.1  christos #define EF_FRV_CPU_FR500	0x01000000	/* FRV500 */
    105   1.1  christos #define EF_FRV_CPU_FR300	0x02000000	/* FRV300 */
    106   1.1  christos #define EF_FRV_CPU_SIMPLE	0x03000000	/* SIMPLE */
    107   1.1  christos #define EF_FRV_CPU_TOMCAT	0x04000000	/* Tomcat, FR500 prototype */
    108   1.1  christos #define EF_FRV_CPU_FR400	0x05000000	/* FRV400 */
    109   1.1  christos #define EF_FRV_CPU_FR550	0x06000000	/* FRV550 */
    110   1.1  christos #define EF_FRV_CPU_FR405	0x07000000
    111   1.1  christos #define EF_FRV_CPU_FR450	0x08000000
    112   1.1  christos 
    113   1.1  christos 						/* Mask of PIC related bits */
    114   1.1  christos #define	EF_FRV_PIC_FLAGS	(EF_FRV_PIC | EF_FRV_LIBPIC | EF_FRV_BIGPIC \
    115   1.1  christos 				 | EF_FRV_FDPIC)
    116   1.1  christos 
    117   1.1  christos 						/* Mask of all flags */
    118   1.1  christos #define EF_FRV_ALL_FLAGS	(EF_FRV_GPR_MASK | \
    119   1.1  christos 				 EF_FRV_FPR_MASK | \
    120   1.1  christos 				 EF_FRV_DWORD_MASK | \
    121   1.1  christos 				 EF_FRV_DOUBLE | \
    122   1.1  christos 				 EF_FRV_MEDIA | \
    123   1.1  christos 				 EF_FRV_PIC_FLAGS | \
    124   1.1  christos 				 EF_FRV_NON_PIC_RELOCS | \
    125   1.1  christos 				 EF_FRV_MULADD | \
    126   1.1  christos 				 EF_FRV_G0 | \
    127   1.1  christos 				 EF_FRV_NOPACK | \
    128   1.1  christos 				 EF_FRV_CPU_MASK)
    129   1.1  christos 
    130   1.1  christos #endif /* _ELF_FRV_H */
    131