Mercurial > ecos
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 |
| rev | line source |
|---|---|
| 2011 | 1 #ifndef __RELOCATE_PPC_H__ |
| 2 #define __RELOCATE_PPC_H__ | |
| 3 | |
| 4 /* ================================================================= | |
| 5 * | |
| 6 * relocate_ppc.h | |
| 7 * | |
| 8 * Architecture dependent relocation routines for the PowerPC | |
| 9 * | |
| 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 | 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 | 42 * ================================================================= |
| 43 * #####DESCRIPTIONBEGIN#### | |
| 44 * | |
| 2243 | 45 * Author(s): Anthony Tonizzo (atonizzo@gmail.com) |
| 2011 | 46 * Date: 2005-05-13 |
| 47 * Purpose: | |
| 48 * Description: | |
| 49 * | |
| 50 * ####DESCRIPTIONEND#### | |
| 51 * | |
| 52 * ================================================================= | |
| 53 */ | |
| 54 | |
| 55 #define Elf_Rel 0 | |
| 56 #define Elf_Rela 1 | |
| 57 #define ELF_ARCH_MACHINE_TYPE 20 // PowerPC. | |
| 58 #define ELF_ARCH_ENDIANNESS ELFDATA2MSB | |
| 59 #define ELF_ARCH_RELTYPE Elf_Rela | |
| 60 | |
| 61 #define R_PPC_NONE 0 | |
| 62 #define R_PPC_ADDR32 1 // 32bit absolute address | |
| 63 #define R_PPC_ADDR24 2 // 26bit address, 2 bits ignored. | |
| 64 #define R_PPC_ADDR16 3 // 16bit absolute address | |
| 65 #define R_PPC_ADDR16_LO 4 // lower 16bit of absolute address | |
| 66 #define R_PPC_ADDR16_HI 5 // high 16bit of absolute address | |
| 67 #define R_PPC_ADDR16_HA 6 // adjusted high 16bit | |
| 68 #define R_PPC_ADDR14 7 // 16bit address, 2 bits ignored | |
| 69 #define R_PPC_ADDR14_BRTAKEN 8 | |
| 70 #define R_PPC_ADDR14_BRNTAKEN 9 | |
| 71 #define R_PPC_REL24 10 // PC relative 26 bit | |
| 72 #define R_PPC_REL14 11 // PC relative 16 bit | |
| 73 #define R_PPC_REL14_BRTAKEN 12 | |
| 74 #define R_PPC_REL14_BRNTAKEN 13 | |
| 75 #define R_PPC_GOT16 14 | |
| 76 #define R_PPC_GOT16_LO 15 | |
| 77 #define R_PPC_GOT16_HI 16 | |
| 78 #define R_PPC_GOT16_HA 17 | |
| 79 #define R_PPC_PLTREL24 18 | |
| 80 #define R_PPC_COPY 19 | |
| 81 #define R_PPC_GLOB_DAT 20 | |
| 82 #define R_PPC_JMP_SLOT 21 | |
| 83 #define R_PPC_RELATIVE 22 | |
| 84 #define R_PPC_LOCAL24PC 23 | |
| 85 #define R_PPC_UADDR32 24 | |
| 86 #define R_PPC_UADDR16 25 | |
| 87 #define R_PPC_REL32 26 | |
| 88 #define R_PPC_PLT32 27 | |
| 89 #define R_PPC_PLTREL32 28 | |
| 90 #define R_PPC_PLT16_LO 29 | |
| 91 #define R_PPC_PLT16_HI 30 | |
| 92 #define R_PPC_PLT16_HA 31 | |
| 93 #define R_PPC_SDAREL16 32 | |
| 94 #define R_PPC_SECTOFF 33 | |
| 95 #define R_PPC_SECTOFF_LO 34 | |
| 96 #define R_PPC_SECTOFF_HI 35 | |
| 97 #define R_PPC_SECTOFF_HA 36 | |
| 98 | |
| 99 // Keep this the last entry. | |
| 100 #define R_PPC_NUM 37 | |
| 101 | |
| 102 // The remaining relocs are from the Embedded ELF ABI, and are not | |
| 103 // in the SVR4 ELF ABI. | |
| 104 #define R_PPC_EMB_NADDR32 101 | |
| 105 #define R_PPC_EMB_NADDR16 102 | |
| 106 #define R_PPC_EMB_NADDR16_LO 103 | |
| 107 #define R_PPC_EMB_NADDR16_HI 104 | |
| 108 #define R_PPC_EMB_NADDR16_HA 105 | |
| 109 #define R_PPC_EMB_SDAI16 106 | |
| 110 #define R_PPC_EMB_SDA2I16 107 | |
| 111 #define R_PPC_EMB_SDA2REL 108 | |
| 112 #define R_PPC_EMB_SDA21 109 // 16 bit offset in SDA | |
| 113 #define R_PPC_EMB_MRKREF 110 | |
| 114 #define R_PPC_EMB_RELSEC16 111 | |
| 115 #define R_PPC_EMB_RELST_LO 112 | |
| 116 #define R_PPC_EMB_RELST_HI 113 | |
| 117 #define R_PPC_EMB_RELST_HA 114 | |
| 118 #define R_PPC_EMB_BIT_FLD 115 | |
| 119 #define R_PPC_EMB_RELSDA 116 // 16 bit relative offset in SDA | |
| 120 | |
| 121 // From the Elf PPC spec. | |
| 122 #define _lo_(x) (x & 0xFFFF) | |
| 123 #define _hi_(x) ((x >> 16) & 0xFFFF) | |
| 124 #define _ha_(x) (((x >> 16)+((x & 0x8000) ? 1 : 0)) & 0xFFFF) | |
| 125 | |
| 126 void cyg_ldr_flush_cache( void ); | |
| 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 | 129 |
| 130 #endif //__RELOCATE_PPC_H__ |
