Home | History | Annotate | Line # | Download | only in elf
      1       1.1     skrll /* ALPHA ELF support for BFD.
      2  1.1.1.10  christos    Copyright (C) 1996-2026 Free Software Foundation, Inc.
      3       1.1     skrll 
      4       1.1     skrll    By Eric Youngdale, <eric (at) aib.com>.  No processor supplement available
      5       1.1     skrll    for this platform.
      6       1.1     skrll 
      7   1.1.1.2  christos    This file is part of BFD, the Binary File Descriptor library.
      8       1.1     skrll 
      9   1.1.1.2  christos    This program is free software; you can redistribute it and/or modify
     10   1.1.1.2  christos    it under the terms of the GNU General Public License as published by
     11   1.1.1.2  christos    the Free Software Foundation; either version 3 of the License, or
     12   1.1.1.2  christos    (at your option) any later version.
     13   1.1.1.2  christos 
     14   1.1.1.2  christos    This program is distributed in the hope that it will be useful,
     15   1.1.1.2  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     16   1.1.1.2  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     17   1.1.1.2  christos    GNU General Public License for more details.
     18   1.1.1.2  christos 
     19   1.1.1.2  christos    You should have received a copy of the GNU General Public License
     20   1.1.1.2  christos    along with this program; if not, write to the Free Software
     21   1.1.1.2  christos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
     22   1.1.1.2  christos    MA 02110-1301, USA.  */
     23       1.1     skrll 
     24       1.1     skrll /* This file holds definitions specific to the ALPHA ELF ABI.  Note
     25       1.1     skrll    that most of this is not actually implemented by BFD.  */
     26       1.1     skrll 
     27       1.1     skrll #ifndef _ELF_ALPHA_H
     28       1.1     skrll #define _ELF_ALPHA_H
     29       1.1     skrll 
     30       1.1     skrll /* Processor specific flags for the ELF header e_flags field.  */
     31       1.1     skrll 
     32       1.1     skrll /* All addresses must be below 2GB.  */
     33       1.1     skrll #define EF_ALPHA_32BIT		0x00000001
     34       1.1     skrll 
     35       1.1     skrll /* All relocations needed for relaxation with code movement are present.  */
     36       1.1     skrll #define EF_ALPHA_CANRELAX	0x00000002
     37       1.1     skrll 
     38       1.1     skrll /* Processor specific section flags.  */
     39       1.1     skrll 
     40       1.1     skrll /* This section must be in the global data area.  */
     41       1.1     skrll #define SHF_ALPHA_GPREL		0x10000000
     42       1.1     skrll 
     43       1.1     skrll /* Section contains some sort of debugging information.  The exact
     44       1.1     skrll    format is unspecified.  It's probably ECOFF symbols.  */
     45   1.1.1.9  christos #define SHT_ALPHA_DEBUG		(SHT_LOPROC + 1)
     46       1.1     skrll 
     47       1.1     skrll /* Section contains register usage information.  */
     48   1.1.1.9  christos #define SHT_ALPHA_REGINFO	(SHT_LOPROC + 2)
     49       1.1     skrll 
     50       1.1     skrll /* A section of type SHT_MIPS_REGINFO contains the following
     51       1.1     skrll    structure.  */
     52       1.1     skrll typedef struct
     53       1.1     skrll {
     54       1.1     skrll   /* Mask of general purpose registers used.  */
     55       1.1     skrll   unsigned long ri_gprmask;
     56       1.1     skrll   /* Mask of co-processor registers used.  */
     57       1.1     skrll   unsigned long ri_cprmask[4];
     58       1.1     skrll   /* GP register value for this object file.  */
     59       1.1     skrll   long ri_gp_value;
     60       1.1     skrll } Elf64_RegInfo;
     61       1.1     skrll 
     62       1.1     skrll /* Special values for the st_other field in the symbol table.  */
     63       1.1     skrll 
     64       1.1     skrll #define STO_ALPHA_NOPV		0x80
     65       1.1     skrll #define STO_ALPHA_STD_GPLOAD	0x88
     66       1.1     skrll 
     67       1.1     skrll /* Special values for Elf64_Dyn tag.  */
     68       1.1     skrll #define DT_ALPHA_PLTRO		DT_LOPROC
     69       1.1     skrll 
     70       1.1     skrll #include "elf/reloc-macros.h"
     71       1.1     skrll 
     72       1.1     skrll /* Alpha relocs.  */
     73       1.1     skrll START_RELOC_NUMBERS (elf_alpha_reloc_type)
     74       1.1     skrll   RELOC_NUMBER (R_ALPHA_NONE, 0)	/* No reloc */
     75       1.1     skrll   RELOC_NUMBER (R_ALPHA_REFLONG, 1)	/* Direct 32 bit */
     76       1.1     skrll   RELOC_NUMBER (R_ALPHA_REFQUAD, 2)	/* Direct 64 bit */
     77       1.1     skrll   RELOC_NUMBER (R_ALPHA_GPREL32, 3)	/* GP relative 32 bit */
     78       1.1     skrll   RELOC_NUMBER (R_ALPHA_LITERAL, 4)	/* GP relative 16 bit w/optimization */
     79       1.1     skrll   RELOC_NUMBER (R_ALPHA_LITUSE, 5)	/* Optimization hint for LITERAL */
     80       1.1     skrll   RELOC_NUMBER (R_ALPHA_GPDISP, 6)	/* Add displacement to GP */
     81       1.1     skrll   RELOC_NUMBER (R_ALPHA_BRADDR, 7)	/* PC+4 relative 23 bit shifted */
     82       1.1     skrll   RELOC_NUMBER (R_ALPHA_HINT, 8)	/* PC+4 relative 16 bit shifted */
     83       1.1     skrll   RELOC_NUMBER (R_ALPHA_SREL16, 9)	/* PC relative 16 bit */
     84       1.1     skrll   RELOC_NUMBER (R_ALPHA_SREL32, 10)	/* PC relative 32 bit */
     85       1.1     skrll   RELOC_NUMBER (R_ALPHA_SREL64, 11)	/* PC relative 64 bit */
     86       1.1     skrll 
     87       1.1     skrll   /* Skip 12 - 16; deprecated ECOFF relocs.  */
     88       1.1     skrll 
     89       1.1     skrll   RELOC_NUMBER (R_ALPHA_GPRELHIGH, 17)	/* GP relative 32 bit, high 16 bits */
     90       1.1     skrll   RELOC_NUMBER (R_ALPHA_GPRELLOW, 18)	/* GP relative 32 bit, low 16 bits */
     91       1.1     skrll   RELOC_NUMBER (R_ALPHA_GPREL16, 19)	/* GP relative 16 bit */
     92       1.1     skrll 
     93       1.1     skrll   /* Skip 20 - 23; deprecated ECOFF relocs.  */
     94       1.1     skrll 
     95       1.1     skrll   /* These relocations are specific to shared libraries.  */
     96       1.1     skrll   RELOC_NUMBER (R_ALPHA_COPY, 24)	/* Copy symbol at runtime */
     97       1.1     skrll   RELOC_NUMBER (R_ALPHA_GLOB_DAT, 25)	/* Create GOT entry */
     98       1.1     skrll   RELOC_NUMBER (R_ALPHA_JMP_SLOT, 26)	/* Create PLT entry */
     99       1.1     skrll   RELOC_NUMBER (R_ALPHA_RELATIVE, 27)	/* Adjust by program base */
    100       1.1     skrll 
    101       1.1     skrll   /* Like BRADDR, but assert that the source and target object file
    102       1.1     skrll      share the same GP value, and adjust the target address for
    103       1.1     skrll      STO_ALPHA_STD_GPLOAD.  */
    104       1.1     skrll   RELOC_NUMBER (R_ALPHA_BRSGP, 28)
    105       1.1     skrll 
    106       1.1     skrll   /* Thread-Local Storage.  */
    107       1.1     skrll   RELOC_NUMBER (R_ALPHA_TLSGD, 29)
    108       1.1     skrll   RELOC_NUMBER (R_ALPHA_TLSLDM, 30)
    109       1.1     skrll   RELOC_NUMBER (R_ALPHA_DTPMOD64, 31)
    110       1.1     skrll   RELOC_NUMBER (R_ALPHA_GOTDTPREL, 32)
    111       1.1     skrll   RELOC_NUMBER (R_ALPHA_DTPREL64, 33)
    112       1.1     skrll   RELOC_NUMBER (R_ALPHA_DTPRELHI, 34)
    113       1.1     skrll   RELOC_NUMBER (R_ALPHA_DTPRELLO, 35)
    114       1.1     skrll   RELOC_NUMBER (R_ALPHA_DTPREL16, 36)
    115       1.1     skrll   RELOC_NUMBER (R_ALPHA_GOTTPREL, 37)
    116       1.1     skrll   RELOC_NUMBER (R_ALPHA_TPREL64, 38)
    117       1.1     skrll   RELOC_NUMBER (R_ALPHA_TPRELHI, 39)
    118       1.1     skrll   RELOC_NUMBER (R_ALPHA_TPRELLO, 40)
    119       1.1     skrll   RELOC_NUMBER (R_ALPHA_TPREL16, 41)
    120       1.1     skrll 
    121       1.1     skrll END_RELOC_NUMBERS (R_ALPHA_max)
    122       1.1     skrll 
    123       1.1     skrll #define LITUSE_ALPHA_ADDR	0
    124       1.1     skrll #define LITUSE_ALPHA_BASE	1
    125       1.1     skrll #define LITUSE_ALPHA_BYTOFF	2
    126       1.1     skrll #define LITUSE_ALPHA_JSR	3
    127       1.1     skrll #define LITUSE_ALPHA_TLSGD	4
    128       1.1     skrll #define LITUSE_ALPHA_TLSLDM	5
    129       1.1     skrll #define LITUSE_ALPHA_JSRDIRECT	6
    130       1.1     skrll 
    131       1.1     skrll #endif /* _ELF_ALPHA_H */
    132