Back to index

cell-binutils  2.17cvs20070401
alpha.h
Go to the documentation of this file.
00001 /* ALPHA ELF support for BFD.
00002    Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
00003 
00004    By Eric Youngdale, <eric@aib.com>.  No processor supplement available
00005    for this platform.
00006 
00007 This file is part of BFD, the Binary File Descriptor library.
00008 
00009 This program is free software; you can redistribute it and/or modify
00010 it under the terms of the GNU General Public License as published by
00011 the Free Software Foundation; either version 2 of the License, or
00012 (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00022 
00023 /* This file holds definitions specific to the ALPHA ELF ABI.  Note
00024    that most of this is not actually implemented by BFD.  */
00025 
00026 #ifndef _ELF_ALPHA_H
00027 #define _ELF_ALPHA_H
00028 
00029 /* Processor specific flags for the ELF header e_flags field.  */
00030 
00031 /* All addresses must be below 2GB.  */
00032 #define EF_ALPHA_32BIT             0x00000001
00033 
00034 /* All relocations needed for relaxation with code movement are present.  */
00035 #define EF_ALPHA_CANRELAX   0x00000002
00036 
00037 /* Processor specific section flags.  */
00038 
00039 /* This section must be in the global data area.  */
00040 #define SHF_ALPHA_GPREL            0x10000000
00041 
00042 /* Section contains some sort of debugging information.  The exact
00043    format is unspecified.  It's probably ECOFF symbols.  */
00044 #define SHT_ALPHA_DEBUG            0x70000001
00045 
00046 /* Section contains register usage information.  */
00047 #define SHT_ALPHA_REGINFO   0x70000002
00048 
00049 /* A section of type SHT_MIPS_REGINFO contains the following
00050    structure.  */
00051 typedef struct
00052 {
00053   /* Mask of general purpose registers used.  */
00054   unsigned long ri_gprmask;
00055   /* Mask of co-processor registers used.  */
00056   unsigned long ri_cprmask[4];
00057   /* GP register value for this object file.  */
00058   long ri_gp_value;
00059 } Elf64_RegInfo;
00060 
00061 /* Special values for the st_other field in the symbol table.  */
00062 
00063 #define STO_ALPHA_NOPV             0x80
00064 #define STO_ALPHA_STD_GPLOAD       0x88
00065 
00066 /* Special values for Elf64_Dyn tag.  */
00067 #define DT_ALPHA_PLTRO             DT_LOPROC
00068 
00069 #include "elf/reloc-macros.h"
00070 
00071 /* Alpha relocs.  */
00072 START_RELOC_NUMBERS (elf_alpha_reloc_type)
00073   RELOC_NUMBER (R_ALPHA_NONE, 0)   /* No reloc */
00074   RELOC_NUMBER (R_ALPHA_REFLONG, 1)       /* Direct 32 bit */
00075   RELOC_NUMBER (R_ALPHA_REFQUAD, 2)       /* Direct 64 bit */
00076   RELOC_NUMBER (R_ALPHA_GPREL32, 3)       /* GP relative 32 bit */
00077   RELOC_NUMBER (R_ALPHA_LITERAL, 4)       /* GP relative 16 bit w/optimization */
00078   RELOC_NUMBER (R_ALPHA_LITUSE, 5) /* Optimization hint for LITERAL */
00079   RELOC_NUMBER (R_ALPHA_GPDISP, 6) /* Add displacement to GP */
00080   RELOC_NUMBER (R_ALPHA_BRADDR, 7) /* PC+4 relative 23 bit shifted */
00081   RELOC_NUMBER (R_ALPHA_HINT, 8)   /* PC+4 relative 16 bit shifted */
00082   RELOC_NUMBER (R_ALPHA_SREL16, 9) /* PC relative 16 bit */
00083   RELOC_NUMBER (R_ALPHA_SREL32, 10)       /* PC relative 32 bit */
00084   RELOC_NUMBER (R_ALPHA_SREL64, 11)       /* PC relative 64 bit */
00085 
00086   /* Skip 12 - 16; deprecated ECOFF relocs.  */
00087 
00088   RELOC_NUMBER (R_ALPHA_GPRELHIGH, 17)    /* GP relative 32 bit, high 16 bits */
00089   RELOC_NUMBER (R_ALPHA_GPRELLOW, 18)     /* GP relative 32 bit, low 16 bits */
00090   RELOC_NUMBER (R_ALPHA_GPREL16, 19)      /* GP relative 16 bit */
00091 
00092   /* Skip 20 - 23; deprecated ECOFF relocs.  */
00093 
00094   /* These relocations are specific to shared libraries.  */
00095   RELOC_NUMBER (R_ALPHA_COPY, 24)  /* Copy symbol at runtime */
00096   RELOC_NUMBER (R_ALPHA_GLOB_DAT, 25)     /* Create GOT entry */
00097   RELOC_NUMBER (R_ALPHA_JMP_SLOT, 26)     /* Create PLT entry */
00098   RELOC_NUMBER (R_ALPHA_RELATIVE, 27)     /* Adjust by program base */
00099 
00100   /* Like BRADDR, but assert that the source and target object file
00101      share the same GP value, and adjust the target address for 
00102      STO_ALPHA_STD_GPLOAD.  */
00103   RELOC_NUMBER (R_ALPHA_BRSGP, 28)
00104 
00105   /* Thread-Local Storage.  */
00106   RELOC_NUMBER (R_ALPHA_TLSGD, 29)
00107   RELOC_NUMBER (R_ALPHA_TLSLDM, 30)
00108   RELOC_NUMBER (R_ALPHA_DTPMOD64, 31)
00109   RELOC_NUMBER (R_ALPHA_GOTDTPREL, 32)
00110   RELOC_NUMBER (R_ALPHA_DTPREL64, 33)
00111   RELOC_NUMBER (R_ALPHA_DTPRELHI, 34)
00112   RELOC_NUMBER (R_ALPHA_DTPRELLO, 35)
00113   RELOC_NUMBER (R_ALPHA_DTPREL16, 36)
00114   RELOC_NUMBER (R_ALPHA_GOTTPREL, 37)
00115   RELOC_NUMBER (R_ALPHA_TPREL64, 38)
00116   RELOC_NUMBER (R_ALPHA_TPRELHI, 39)
00117   RELOC_NUMBER (R_ALPHA_TPRELLO, 40)
00118   RELOC_NUMBER (R_ALPHA_TPREL16, 41)
00119 
00120 END_RELOC_NUMBERS (R_ALPHA_max)
00121 
00122 #define LITUSE_ALPHA_ADDR   0
00123 #define LITUSE_ALPHA_BASE   1
00124 #define LITUSE_ALPHA_BYTOFF 2
00125 #define LITUSE_ALPHA_JSR    3
00126 #define LITUSE_ALPHA_TLSGD  4
00127 #define LITUSE_ALPHA_TLSLDM 5
00128 #define LITUSE_ALPHA_JSRDIRECT     6
00129 
00130 #endif /* _ELF_ALPHA_H */