annotate packages/services/objloader/current/include/relocate_ppc.h @ 2890:f8dd12428f1d

* cdl/objloader.cdl, src/objelf.c, src/relocate_ppc.c, src/relocate_arm.c: Eliminate dependency on CYGPKG_IO_FILEIO when the filesystem loader is not required. * src/relocate_arm.c : Added relocation software for the ARM . * src/relocate_i386.c : Added a structure containing the relocation names for every architecture. Only used (and compiled in) for pretty printing. * src/relocate_ppc.c : * include/relocate_arm.h : New header file for src/relocate_arm.c * cdl/objloader.cdl: Added the option to relocate for the ARM. * src/objloader.c : * src/objelf.c : Erased some redundant debug printout and improved the readability of the rest. * src/loader_memory.c : Added the code to allow the objloader package to load libraries from ROM memory, instead from a file system. The various sections of the library are the copied from ROM to RAM and relocated. * include/loader_memory.h : New header file for src/loader_memory.c * src/objloader.c : Added a line to include the loader_memory header file and code to flush the cache when calling cyg_ldr_find_symbol(). * cdl/objloader.cdl: Added one check boxe for each of the supported ways of loading libraries (two for now) so that the user can compile out the loading methods not used.
author jld
date Fri, 03 Jul 2009 14:49:44 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
1 #ifndef __RELOCATE_PPC_H__
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
2 #define __RELOCATE_PPC_H__
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
4 /* =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
5 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
6 * relocate_ppc.h
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
7 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
8 * Architecture dependent relocation routines for the PowerPC
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
9 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
10 * =================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
11 * ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
12 * -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
13 * This file is part of eCos, the Embedded Configurable Operating System.
2890
f8dd12428f1d * cdl/objloader.cdl, src/objelf.c, src/relocate_ppc.c,
jld
parents: 2729
diff changeset
14 * Copyright (C) 2005, 2008 Free Software Foundation, Inc.
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
15 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
16 * eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
17 * the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
18 * Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
19 * version.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
20 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
21 * eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
22 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
23 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
24 * for more details.
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
25 *
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
26 * You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
27 * along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
29 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
30 * As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
31 * macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
32 * and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
33 * this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
34 * the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
35 * must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
36 * General Public License v2.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
37 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
38 * This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
39 * on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
40 * -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
41 * ####ECOSGPLCOPYRIGHTEND####
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
42 * =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
43 * #####DESCRIPTIONBEGIN####
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
44 *
2243
6fd46febe457 Warnings, cosmetic fixes from Anthony Tonizzo
gthomas
parents: 2011
diff changeset
45 * Author(s): Anthony Tonizzo (atonizzo@gmail.com)
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
46 * Date: 2005-05-13
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
47 * Purpose:
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
48 * Description:
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
49 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
50 * ####DESCRIPTIONEND####
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
51 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
52 * =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
53 */
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
54
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
55 #define Elf_Rel 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
56 #define Elf_Rela 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
57 #define ELF_ARCH_MACHINE_TYPE 20 // PowerPC.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
58 #define ELF_ARCH_ENDIANNESS ELFDATA2MSB
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
59 #define ELF_ARCH_RELTYPE Elf_Rela
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
60
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
61 #define R_PPC_NONE 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
62 #define R_PPC_ADDR32 1 // 32bit absolute address
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
63 #define R_PPC_ADDR24 2 // 26bit address, 2 bits ignored.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
64 #define R_PPC_ADDR16 3 // 16bit absolute address
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
65 #define R_PPC_ADDR16_LO 4 // lower 16bit of absolute address
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
66 #define R_PPC_ADDR16_HI 5 // high 16bit of absolute address
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
67 #define R_PPC_ADDR16_HA 6 // adjusted high 16bit
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
68 #define R_PPC_ADDR14 7 // 16bit address, 2 bits ignored
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
69 #define R_PPC_ADDR14_BRTAKEN 8
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
70 #define R_PPC_ADDR14_BRNTAKEN 9
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
71 #define R_PPC_REL24 10 // PC relative 26 bit
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
72 #define R_PPC_REL14 11 // PC relative 16 bit
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
73 #define R_PPC_REL14_BRTAKEN 12
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
74 #define R_PPC_REL14_BRNTAKEN 13
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
75 #define R_PPC_GOT16 14
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
76 #define R_PPC_GOT16_LO 15
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
77 #define R_PPC_GOT16_HI 16
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
78 #define R_PPC_GOT16_HA 17
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
79 #define R_PPC_PLTREL24 18
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
80 #define R_PPC_COPY 19
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
81 #define R_PPC_GLOB_DAT 20
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
82 #define R_PPC_JMP_SLOT 21
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
83 #define R_PPC_RELATIVE 22
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
84 #define R_PPC_LOCAL24PC 23
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
85 #define R_PPC_UADDR32 24
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
86 #define R_PPC_UADDR16 25
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
87 #define R_PPC_REL32 26
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
88 #define R_PPC_PLT32 27
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
89 #define R_PPC_PLTREL32 28
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
90 #define R_PPC_PLT16_LO 29
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
91 #define R_PPC_PLT16_HI 30
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
92 #define R_PPC_PLT16_HA 31
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
93 #define R_PPC_SDAREL16 32
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
94 #define R_PPC_SECTOFF 33
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
95 #define R_PPC_SECTOFF_LO 34
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
96 #define R_PPC_SECTOFF_HI 35
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
97 #define R_PPC_SECTOFF_HA 36
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
98
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
99 // Keep this the last entry.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
100 #define R_PPC_NUM 37
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
101
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
102 // The remaining relocs are from the Embedded ELF ABI, and are not
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
103 // in the SVR4 ELF ABI.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
104 #define R_PPC_EMB_NADDR32 101
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
105 #define R_PPC_EMB_NADDR16 102
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
106 #define R_PPC_EMB_NADDR16_LO 103
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
107 #define R_PPC_EMB_NADDR16_HI 104
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
108 #define R_PPC_EMB_NADDR16_HA 105
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
109 #define R_PPC_EMB_SDAI16 106
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
110 #define R_PPC_EMB_SDA2I16 107
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
111 #define R_PPC_EMB_SDA2REL 108
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
112 #define R_PPC_EMB_SDA21 109 // 16 bit offset in SDA
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
113 #define R_PPC_EMB_MRKREF 110
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
114 #define R_PPC_EMB_RELSEC16 111
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
115 #define R_PPC_EMB_RELST_LO 112
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
116 #define R_PPC_EMB_RELST_HI 113
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
117 #define R_PPC_EMB_RELST_HA 114
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
118 #define R_PPC_EMB_BIT_FLD 115
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
119 #define R_PPC_EMB_RELSDA 116 // 16 bit relative offset in SDA
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
120
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
121 // From the Elf PPC spec.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
122 #define _lo_(x) (x & 0xFFFF)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
123 #define _hi_(x) ((x >> 16) & 0xFFFF)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
124 #define _ha_(x) (((x >> 16)+((x & 0x8000) ? 1 : 0)) & 0xFFFF)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
125
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
126 void cyg_ldr_flush_cache( void );
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
127 cyg_int32 cyg_ldr_relocate( cyg_int32, cyg_uint32, cyg_int32 );
2890
f8dd12428f1d * cdl/objloader.cdl, src/objelf.c, src/relocate_ppc.c,
jld
parents: 2729
diff changeset
128 extern char *relocation_name[];
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
129
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
130 #endif //__RELOCATE_PPC_H__