Subversion Repositories Kolibri OS

Rev

Rev 5191 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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