OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [services/] [loader/] [current/] [include/] [arm_elf.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_LOADER_ARM_ELF_H
2
#define CYGONCE_LOADER_ARM_ELF_H
3
 
4
//==========================================================================
5
//
6
//      arm_elf.h
7
//
8
//      ARM specific ELF file format support
9
//
10
//==========================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####                                            
12
// -------------------------------------------                              
13
// This file is part of eCos, the Embedded Configurable Operating System.   
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under    
17
// the terms of the GNU General Public License as published by the Free     
18
// Software Foundation; either version 2 or (at your option) any later      
19
// version.                                                                 
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT      
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
24
// for more details.                                                        
25
//
26
// You should have received a copy of the GNU General Public License        
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,    
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
29
//
30
// As a special exception, if other files instantiate templates or use      
31
// macros or inline functions from this file, or you compile this file      
32
// and link it with other works to produce a work based on this file,       
33
// this file does not by itself cause the resulting work to be covered by   
34
// the GNU General Public License. However the source code for this file    
35
// must still be made available in accordance with section (3) of the GNU   
36
// General Public License v2.                                               
37
//
38
// This exception does not invalidate any other reasons why a work based    
39
// on this file might be covered by the GNU General Public License.         
40
// -------------------------------------------                              
41
// ####ECOSGPLCOPYRIGHTEND####                                              
42
//==========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):    nickg
46
// Contributors: nickg
47
// Date:         2000-11-20
48
// Purpose:      Define ARM ELF support
49
// Description:  This file contains definitions for configuring the dynamic
50
//               loader to deal with the ARM specific parts of the ELF
51
//               file format.
52
//              
53
// Usage:
54
//              #include <cyg/loader/arm_elf.h>
55
//              ...
56
//              
57
//
58
//####DESCRIPTIONEND####
59
//
60
//==========================================================================
61
 
62
#include <pkgconf/system.h>
63
#include <pkgconf/hal.h>
64
 
65
 
66
#if defined(CYGPKG_HAL_ARM)
67
 
68
#ifndef CYG_LOADER_DYNAMIC_LD
69
 
70
#include <cyg/infra/cyg_type.h>
71
 
72
//--------------------------------------------------------------------------
73
// Basic definitions
74
 
75
#define CYG_ELF_MACHINE     EM_ARM
76
 
77
//--------------------------------------------------------------------------
78
// Relocation types
79
// Taken from bfd/include/elf/arm.h - not currently sure which of these
80
// are actually used in executables.
81
 
82
#define R_ARM_NONE         0
83
#define R_ARM_PC24         1
84
#define R_ARM_ABS32        2
85
#define R_ARM_REL32        3
86
#define R_ARM_PC13         4
87
#define R_ARM_ABS16        5
88
#define R_ARM_ABS12        6
89
#define R_ARM_THM_ABS5     7
90
#define R_ARM_ABS8         8
91
#define R_ARM_SBREL32      9
92
#define R_ARM_THM_PC22    10
93
#define R_ARM_THM_PC8     11
94
#define R_ARM_AMP_VCALL9  12
95
#define R_ARM_SWI24       13
96
#define R_ARM_THM_SWI8    14
97
#define R_ARM_XPC25       15
98
#define R_ARM_THM_XPC22   16
99
#define R_ARM_COPY        20       /* copy symbol at runtime */
100
#define R_ARM_GLOB_DAT    21       /* create GOT entry */
101
#define R_ARM_JUMP_SLOT   22       /* create PLT entry */
102
#define R_ARM_RELATIVE    23       /* adjust by program base */
103
#define R_ARM_GOTOFF      24       /* 32 bit offset to GOT */
104
#define R_ARM_GOTPC       25       /* 32 bit PC relative offset to GOT */
105
#define R_ARM_GOT32       26       /* 32 bit GOT entry */
106
#define R_ARM_PLT32       27       /* 32 bit PLT address */
107
#define R_ARM_GNU_VTENTRY 100
108
#define R_ARM_GNU_VTINHERIT 101
109
#define R_ARM_THM_PC11    102       /* Cygnus extension to abi: Thumb unconditional branch */
110
#define R_ARM_THM_PC9     103       /* Cygnus extension to abi: Thumb conditional branch */
111
#define R_ARM_RXPC25     249
112
#define R_ARM_RSBREL32   250
113
#define R_ARM_THM_RPC22  251
114
#define R_ARM_RREL32     252
115
#define R_ARM_RABS32     253
116
#define R_ARM_RPC24      254
117
#define R_ARM_RBASE      255
118
 
119
 
120
//--------------------------------------------------------------------------
121
// Processor specific customization class for Cyg_LoadObject class.
122
 
123
#ifdef __cplusplus
124
 
125
class Cyg_LoadObject_Proc :
126
      public Cyg_LoadObject_Base
127
{
128
 public:
129
 
130
    inline Cyg_LoadObject_Proc()
131
        : Cyg_LoadObject_Base()
132
        {
133
        };
134
 
135
    inline Cyg_LoadObject_Proc( Cyg_LoaderStream& stream,
136
                    cyg_uint32 mode,
137
                    Cyg_LoaderMemAlloc *mem )
138
        : Cyg_LoadObject_Base( stream, mode, mem )
139
        {
140
        };
141
 
142
    inline ~Cyg_LoadObject_Proc() {};
143
 
144
    cyg_code apply_rel( unsigned char type, Elf32_Word sym, Elf32_Addr offset );
145
 
146
    cyg_code apply_rela( unsigned char type, Elf32_Word sym,
147
                         Elf32_Addr offset, Elf32_Sword addend );
148
};
149
 
150
//--------------------------------------------------------------------------
151
 
152
inline cyg_code Cyg_LoadObject_Proc::apply_rel( unsigned char type,
153
                                                Elf32_Word sym,
154
                                                Elf32_Addr offset )
155
{
156
    return 0;
157
}
158
 
159
inline cyg_code Cyg_LoadObject_Proc::apply_rela( unsigned char type,
160
                                                 Elf32_Word sym,
161
                                                 Elf32_Addr offset,
162
                                                 Elf32_Sword addend )
163
{
164
    return 0;
165
}
166
 
167
 
168
//--------------------------------------------------------------------------
169
 
170
#endif // __cplusplus
171
 
172
#else // CYG_LOADER_DYNAMIC_LD
173
 
174
//--------------------------------------------------------------------------
175
 
176
#define CYG_LOADER_DYNAMIC_PREFIX                                               \
177
        OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")     \
178
        OUTPUT_ARCH("arm")
179
 
180
//--------------------------------------------------------------------------
181
 
182
#endif // CYG_LOADER_DYNAMIC_LD
183
 
184
#endif // defined(CYGPKG_HAL_ARM) 
185
 
186
//--------------------------------------------------------------------------
187
#endif // ifndef CYGONCE_LOADER_ARM_ELF_H
188
// End of arm_elf.h

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.