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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_LOADER_MIPS_ELF_H
2
#define CYGONCE_LOADER_MIPS_ELF_H
3
 
4
//==========================================================================
5
//
6
//      mips_elf.h
7
//
8
//      MIPS 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 MIPS ELF support
49
// Description:  This file contains definitions for configuring the dynamic
50
//               loader to deal with the MIPS specific parts of the ELF
51
//               file format.
52
//              
53
// Usage:
54
//              #include <cyg/loader/mips_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_MIPS)
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_MIPS
76
 
77
//--------------------------------------------------------------------------
78
// Relocation types
79
// Taken from bfd/include/elf/mips.h - not currently sure which of these
80
// are actually used in executables.
81
 
82
#define R_MIPS_NONE                     0
83
#define R_MIPS_16                       1
84
#define R_MIPS_32                       2
85
#define R_MIPS_REL32                    3
86
#define R_MIPS_26                       4
87
#define R_MIPS_HI16                     5
88
#define R_MIPS_LO16                     6
89
#define R_MIPS_GPREL16                  7
90
#define R_MIPS_LITERAL                  8
91
#define R_MIPS_GOT16                    9
92
#define R_MIPS_PC16                     10
93
#define R_MIPS_CALL16                   11
94
#define R_MIPS_GPREL32                  12
95
/* Irix and MIPS16 relocs currently omitted. */
96
/* These are GNU extensions to handle embedded-pic.  */
97
#define R_MIPS_PC32                     248
98
#define R_MIPS_PC64                     249
99
#define R_MIPS_GNU_REL16_S2             250
100
#define R_MIPS_GNU_REL_LO16             251
101
#define R_MIPS_GNU_REL_HI16             252
102
/* These are GNU extensions to enable C++ vtable garbage collection.  */
103
#define R_MIPS_GNU_VTINHERIT            253
104
#define R_MIPS_GNU_VTENTRY              254
105
 
106
//--------------------------------------------------------------------------
107
// Processor specific customization class for Cyg_LoadObject class.
108
 
109
#ifdef __cplusplus
110
 
111
class Cyg_LoadObject_Proc :
112
      public Cyg_LoadObject_Base
113
{
114
 public:
115
 
116
    inline Cyg_LoadObject_Proc()
117
        : Cyg_LoadObject_Base()
118
        {
119
        };
120
 
121
    inline Cyg_LoadObject_Proc( Cyg_LoaderStream& stream,
122
                    cyg_uint32 mode,
123
                    Cyg_LoaderMemAlloc *mem )
124
        : Cyg_LoadObject_Base( stream, mode, mem )
125
        {
126
        };
127
 
128
    inline ~Cyg_LoadObject_Proc() {};
129
 
130
    cyg_code apply_rel( unsigned char type, Elf32_Word sym, Elf32_Addr offset );
131
 
132
    cyg_code apply_rela( unsigned char type, Elf32_Word sym,
133
                         Elf32_Addr offset, Elf32_Sword addend );
134
};
135
 
136
//--------------------------------------------------------------------------
137
 
138
inline cyg_code Cyg_LoadObject_Proc::apply_rel( unsigned char type,
139
                                                Elf32_Word sym,
140
                                                Elf32_Addr offset )
141
{
142
    return 0;
143
}
144
 
145
inline cyg_code Cyg_LoadObject_Proc::apply_rela( unsigned char type,
146
                                                 Elf32_Word sym,
147
                                                 Elf32_Addr offset,
148
                                                 Elf32_Sword addend )
149
{
150
    return 0;
151
}
152
 
153
 
154
//--------------------------------------------------------------------------
155
 
156
#endif // __cplusplus
157
 
158
#else // CYG_LOADER_DYNAMIC_LD
159
 
160
//--------------------------------------------------------------------------
161
 
162
#define CYG_LOADER_DYNAMIC_PREFIX                                               \
163
        OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")     \
164
        OUTPUT_ARCH("mips")
165
 
166
 
167
//--------------------------------------------------------------------------
168
 
169
#endif // CYG_LOADER_DYNAMIC_LD
170
 
171
#endif // defined(CYGPKG_HAL_MIPS) 
172
 
173
//--------------------------------------------------------------------------
174
#endif // ifndef CYGONCE_LOADER_MIPS_ELF_H
175
// End of mips_elf.h

powered by: WebSVN 2.1.0

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