xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/avr.h (revision e663ba6e3a60083e70de702e9d54bf486a57b6a7)
198b9484cSchristos /* AVR ELF support for BFD.
2*e663ba6eSchristos    Copyright (C) 1999-2024 Free Software Foundation, Inc.
398b9484cSchristos    Contributed by Denis Chertykov <denisc@overta.ru>
498b9484cSchristos 
598b9484cSchristos    This file is part of BFD, the Binary File Descriptor library.
698b9484cSchristos 
798b9484cSchristos    This program is free software; you can redistribute it and/or modify
898b9484cSchristos    it under the terms of the GNU General Public License as published by
998b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
1098b9484cSchristos    (at your option) any later version.
1198b9484cSchristos 
1298b9484cSchristos    This program is distributed in the hope that it will be useful,
1398b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1498b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1598b9484cSchristos    GNU General Public License for more details.
1698b9484cSchristos 
1798b9484cSchristos    You should have received a copy of the GNU General Public License
1898b9484cSchristos    along with this program; if not, write to the Free Software Foundation,
1998b9484cSchristos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2098b9484cSchristos 
2198b9484cSchristos #ifndef _ELF_AVR_H
2298b9484cSchristos #define _ELF_AVR_H
2398b9484cSchristos 
2498b9484cSchristos #include "elf/reloc-macros.h"
2598b9484cSchristos 
2698b9484cSchristos /* Processor specific flags for the ELF header e_flags field.  */
2798b9484cSchristos #define EF_AVR_MACH 0x7F
2898b9484cSchristos 
2998b9484cSchristos /* If bit #7 is set, it is assumed that the elf file uses local symbols
3098b9484cSchristos    as reference for the relocations so that linker relaxation is possible.  */
3198b9484cSchristos #define EF_AVR_LINKRELAX_PREPARED 0x80
3298b9484cSchristos 
3398b9484cSchristos #define E_AVR_MACH_AVR1     1
3498b9484cSchristos #define E_AVR_MACH_AVR2     2
3598b9484cSchristos #define E_AVR_MACH_AVR25   25
3698b9484cSchristos #define E_AVR_MACH_AVR3     3
3798b9484cSchristos #define E_AVR_MACH_AVR31   31
3898b9484cSchristos #define E_AVR_MACH_AVR35   35
3998b9484cSchristos #define E_AVR_MACH_AVR4     4
4098b9484cSchristos #define E_AVR_MACH_AVR5     5
4198b9484cSchristos #define E_AVR_MACH_AVR51   51
4298b9484cSchristos #define E_AVR_MACH_AVR6     6
43968cf8f2Schristos #define E_AVR_MACH_AVRTINY 100
4498b9484cSchristos #define E_AVR_MACH_XMEGA1  101
4598b9484cSchristos #define E_AVR_MACH_XMEGA2  102
4698b9484cSchristos #define E_AVR_MACH_XMEGA3  103
4798b9484cSchristos #define E_AVR_MACH_XMEGA4  104
4898b9484cSchristos #define E_AVR_MACH_XMEGA5  105
4998b9484cSchristos #define E_AVR_MACH_XMEGA6  106
5098b9484cSchristos #define E_AVR_MACH_XMEGA7  107
5198b9484cSchristos 
5298b9484cSchristos /* Relocations.  */
5398b9484cSchristos START_RELOC_NUMBERS (elf_avr_reloc_type)
5498b9484cSchristos      RELOC_NUMBER (R_AVR_NONE,			0)
5598b9484cSchristos      RELOC_NUMBER (R_AVR_32,			1)
5698b9484cSchristos      RELOC_NUMBER (R_AVR_7_PCREL,		2)
5798b9484cSchristos      RELOC_NUMBER (R_AVR_13_PCREL,		3)
5898b9484cSchristos      RELOC_NUMBER (R_AVR_16, 			4)
5998b9484cSchristos      RELOC_NUMBER (R_AVR_16_PM, 		5)
6098b9484cSchristos      RELOC_NUMBER (R_AVR_LO8_LDI,		6)
6198b9484cSchristos      RELOC_NUMBER (R_AVR_HI8_LDI,		7)
6298b9484cSchristos      RELOC_NUMBER (R_AVR_HH8_LDI,		8)
6398b9484cSchristos      RELOC_NUMBER (R_AVR_LO8_LDI_NEG,		9)
6498b9484cSchristos      RELOC_NUMBER (R_AVR_HI8_LDI_NEG,	       10)
6598b9484cSchristos      RELOC_NUMBER (R_AVR_HH8_LDI_NEG,	       11)
6698b9484cSchristos      RELOC_NUMBER (R_AVR_LO8_LDI_PM,	       12)
6798b9484cSchristos      RELOC_NUMBER (R_AVR_HI8_LDI_PM,	       13)
6898b9484cSchristos      RELOC_NUMBER (R_AVR_HH8_LDI_PM,	       14)
6998b9484cSchristos      RELOC_NUMBER (R_AVR_LO8_LDI_PM_NEG,       15)
7098b9484cSchristos      RELOC_NUMBER (R_AVR_HI8_LDI_PM_NEG,       16)
7198b9484cSchristos      RELOC_NUMBER (R_AVR_HH8_LDI_PM_NEG,       17)
7298b9484cSchristos      RELOC_NUMBER (R_AVR_CALL,		       18)
7398b9484cSchristos      RELOC_NUMBER (R_AVR_LDI,                  19)
7498b9484cSchristos      RELOC_NUMBER (R_AVR_6,                    20)
7598b9484cSchristos      RELOC_NUMBER (R_AVR_6_ADIW,               21)
7698b9484cSchristos      RELOC_NUMBER (R_AVR_MS8_LDI,              22)
7798b9484cSchristos      RELOC_NUMBER (R_AVR_MS8_LDI_NEG,          23)
7898b9484cSchristos      RELOC_NUMBER (R_AVR_LO8_LDI_GS,	       24)
7998b9484cSchristos      RELOC_NUMBER (R_AVR_HI8_LDI_GS,	       25)
8098b9484cSchristos      RELOC_NUMBER (R_AVR_8, 		       26)
81a2e2270fSchristos      RELOC_NUMBER (R_AVR_8_LO8,                27)
82a2e2270fSchristos      RELOC_NUMBER (R_AVR_8_HI8,                28)
83a2e2270fSchristos      RELOC_NUMBER (R_AVR_8_HLO8,               29)
84968cf8f2Schristos      RELOC_NUMBER (R_AVR_DIFF8,                30)
85968cf8f2Schristos      RELOC_NUMBER (R_AVR_DIFF16,               31)
86968cf8f2Schristos      RELOC_NUMBER (R_AVR_DIFF32,               32)
87968cf8f2Schristos      RELOC_NUMBER (R_AVR_LDS_STS_16,           33)
88968cf8f2Schristos      RELOC_NUMBER (R_AVR_PORT6,                34)
89968cf8f2Schristos      RELOC_NUMBER (R_AVR_PORT5,                35)
90ba340e45Schristos      RELOC_NUMBER (R_AVR_32_PCREL,             36)
9198b9484cSchristos END_RELOC_NUMBERS (R_AVR_max)
9298b9484cSchristos 
9398b9484cSchristos #endif /* _ELF_AVR_H */
94