diff options
author | Richard Purdie <richard@openedhand.com> | 2007-01-18 10:30:19 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-01-18 10:30:19 +0000 |
commit | 9c4684a670a25975d9aee1ffb40e5e720ce7611d (patch) | |
tree | d2d76c323a47e3425db48fb02f9fadddebb90cdd | |
parent | 341f8fc06de8cfa3bcc6e40da0febe30b2088860 (diff) | |
download | poky-9c4684a670a25975d9aee1ffb40e5e720ce7611d.tar.gz |
prelink: Fix EABI segfaults
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1162 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r-- | meta/packages/prelink/prelink-20061027/arm_eabi.patch | 50 | ||||
-rw-r--r-- | meta/packages/prelink/prelink_20061027.bb | 2 |
2 files changed, 28 insertions, 24 deletions
diff --git a/meta/packages/prelink/prelink-20061027/arm_eabi.patch b/meta/packages/prelink/prelink-20061027/arm_eabi.patch index b234af9b3f..b138b5a6d5 100644 --- a/meta/packages/prelink/prelink-20061027/arm_eabi.patch +++ b/meta/packages/prelink/prelink-20061027/arm_eabi.patch | |||
@@ -1,8 +1,12 @@ | |||
1 | Index: prelink-0.0.20050901/src/arch-arm.c | 1 | --- |
2 | src/arch-arm.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- | ||
3 | 1 file changed, 165 insertions(+), 5 deletions(-) | ||
4 | |||
5 | Index: prelink-0.0.20061027/src/arch-arm.c | ||
2 | =================================================================== | 6 | =================================================================== |
3 | --- prelink-0.0.20050901.orig/src/arch-arm.c 2004-09-30 17:07:57.000000000 +0100 | 7 | --- prelink-0.0.20061027.orig/src/arch-arm.c 2006-08-13 16:18:17.000000000 +0100 |
4 | +++ prelink-0.0.20050901/src/arch-arm.c 2006-04-07 14:41:25.000000000 +0100 | 8 | +++ prelink-0.0.20061027/src/arch-arm.c 2007-01-14 00:05:33.000000000 +0000 |
5 | @@ -145,6 +145,24 @@ | 9 | @@ -145,6 +145,24 @@ arm_prelink_rel (struct prelink_info *in |
6 | error (0, 0, "%s: R_ARM_PC24 relocs with non-zero addend should not be present in prelinked REL sections", | 10 | error (0, 0, "%s: R_ARM_PC24 relocs with non-zero addend should not be present in prelinked REL sections", |
7 | dso->filename); | 11 | dso->filename); |
8 | return 1; | 12 | return 1; |
@@ -27,7 +31,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
27 | case R_ARM_COPY: | 31 | case R_ARM_COPY: |
28 | if (dso->ehdr.e_type == ET_EXEC) | 32 | if (dso->ehdr.e_type == ET_EXEC) |
29 | /* COPY relocs are handled specially in generic code. */ | 33 | /* COPY relocs are handled specially in generic code. */ |
30 | @@ -195,6 +213,24 @@ | 34 | @@ -195,6 +213,24 @@ arm_prelink_rela (struct prelink_info *i |
31 | write_le32 (dso, rela->r_offset, | 35 | write_le32 (dso, rela->r_offset, |
32 | (read_ule32 (dso, rela->r_offset) & 0xff000000) | val); | 36 | (read_ule32 (dso, rela->r_offset) & 0xff000000) | val); |
33 | break; | 37 | break; |
@@ -47,12 +51,12 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
47 | + case R_ARM_TLS_TPOFF32: | 51 | + case R_ARM_TLS_TPOFF32: |
48 | + if (dso->ehdr.e_type == ET_EXEC && info->resolvetls) | 52 | + if (dso->ehdr.e_type == ET_EXEC && info->resolvetls) |
49 | + write_le32 (dso, rela->r_offset, | 53 | + write_le32 (dso, rela->r_offset, |
50 | + -(value + rela->r_addend - info->resolvetls->offset)); | 54 | + value + rela->r_addend + info->resolvetls->offset); |
51 | + break; | 55 | + break; |
52 | case R_ARM_COPY: | 56 | case R_ARM_COPY: |
53 | if (dso->ehdr.e_type == ET_EXEC) | 57 | if (dso->ehdr.e_type == ET_EXEC) |
54 | /* COPY relocs are handled specially in generic code. */ | 58 | /* COPY relocs are handled specially in generic code. */ |
55 | @@ -315,6 +351,7 @@ | 59 | @@ -315,6 +351,7 @@ arm_prelink_conflict_rel (DSO *dso, stru |
56 | { | 60 | { |
57 | GElf_Addr value; | 61 | GElf_Addr value; |
58 | struct prelink_conflict *conflict; | 62 | struct prelink_conflict *conflict; |
@@ -60,7 +64,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
60 | GElf_Rela *ret; | 64 | GElf_Rela *ret; |
61 | 65 | ||
62 | if (GELF_R_TYPE (rel->r_info) == R_ARM_RELATIVE | 66 | if (GELF_R_TYPE (rel->r_info) == R_ARM_RELATIVE |
63 | @@ -324,8 +361,31 @@ | 67 | @@ -324,8 +361,31 @@ arm_prelink_conflict_rel (DSO *dso, stru |
64 | conflict = prelink_conflict (info, GELF_R_SYM (rel->r_info), | 68 | conflict = prelink_conflict (info, GELF_R_SYM (rel->r_info), |
65 | GELF_R_TYPE (rel->r_info)); | 69 | GELF_R_TYPE (rel->r_info)); |
66 | if (conflict == NULL) | 70 | if (conflict == NULL) |
@@ -94,7 +98,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
94 | ret = prelink_conflict_add_rela (info); | 98 | ret = prelink_conflict_add_rela (info); |
95 | if (ret == NULL) | 99 | if (ret == NULL) |
96 | return 1; | 100 | return 1; |
97 | @@ -342,6 +402,33 @@ | 101 | @@ -342,6 +402,33 @@ arm_prelink_conflict_rel (DSO *dso, stru |
98 | error (0, 0, "%s: R_ARM_%s relocs should not be present in prelinked REL sections", | 102 | error (0, 0, "%s: R_ARM_%s relocs should not be present in prelinked REL sections", |
99 | dso->filename, GELF_R_TYPE (rel->r_info) == R_ARM_ABS32 ? "ABS32" : "PC24"); | 103 | dso->filename, GELF_R_TYPE (rel->r_info) == R_ARM_ABS32 ? "ABS32" : "PC24"); |
100 | return 1; | 104 | return 1; |
@@ -120,15 +124,15 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
120 | + ret->r_addend = value; | 124 | + ret->r_addend = value; |
121 | + break; | 125 | + break; |
122 | + case R_ARM_TLS_TPOFF32: | 126 | + case R_ARM_TLS_TPOFF32: |
123 | + ret->r_addend = -(value + read_ule32 (dso, rel->r_offset) | 127 | + ret->r_addend = value + read_ule32 (dso, rel->r_offset) |
124 | + - tls->offset); | 128 | + + tls->offset; |
125 | + break; | 129 | + break; |
126 | + } | 130 | + } |
127 | + break; | 131 | + break; |
128 | case R_ARM_COPY: | 132 | case R_ARM_COPY: |
129 | error (0, 0, "R_ARM_COPY should not be present in shared libraries"); | 133 | error (0, 0, "R_ARM_COPY should not be present in shared libraries"); |
130 | return 1; | 134 | return 1; |
131 | @@ -359,6 +446,7 @@ | 135 | @@ -359,6 +446,7 @@ arm_prelink_conflict_rela (DSO *dso, str |
132 | { | 136 | { |
133 | GElf_Addr value; | 137 | GElf_Addr value; |
134 | struct prelink_conflict *conflict; | 138 | struct prelink_conflict *conflict; |
@@ -136,7 +140,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
136 | GElf_Rela *ret; | 140 | GElf_Rela *ret; |
137 | Elf32_Sword val; | 141 | Elf32_Sword val; |
138 | 142 | ||
139 | @@ -369,8 +457,31 @@ | 143 | @@ -369,8 +457,31 @@ arm_prelink_conflict_rela (DSO *dso, str |
140 | conflict = prelink_conflict (info, GELF_R_SYM (rela->r_info), | 144 | conflict = prelink_conflict (info, GELF_R_SYM (rela->r_info), |
141 | GELF_R_TYPE (rela->r_info)); | 145 | GELF_R_TYPE (rela->r_info)); |
142 | if (conflict == NULL) | 146 | if (conflict == NULL) |
@@ -170,7 +174,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
170 | ret = prelink_conflict_add_rela (info); | 174 | ret = prelink_conflict_add_rela (info); |
171 | if (ret == NULL) | 175 | if (ret == NULL) |
172 | return 1; | 176 | return 1; |
173 | @@ -398,6 +509,32 @@ | 177 | @@ -398,6 +509,32 @@ arm_prelink_conflict_rela (DSO *dso, str |
174 | case R_ARM_COPY: | 178 | case R_ARM_COPY: |
175 | error (0, 0, "R_ARM_COPY should not be present in shared libraries"); | 179 | error (0, 0, "R_ARM_COPY should not be present in shared libraries"); |
176 | return 1; | 180 | return 1; |
@@ -196,14 +200,14 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
196 | + ret->r_addend += value; | 200 | + ret->r_addend += value; |
197 | + break; | 201 | + break; |
198 | + case R_ARM_TLS_TPOFF32: | 202 | + case R_ARM_TLS_TPOFF32: |
199 | + ret->r_addend = -(value + rela->r_addend - tls->offset); | 203 | + ret->r_addend = value + rela->r_addend + tls->offset; |
200 | + break; | 204 | + break; |
201 | + } | 205 | + } |
202 | + break; | 206 | + break; |
203 | default: | 207 | default: |
204 | error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, | 208 | error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, |
205 | (int) GELF_R_TYPE (rela->r_info)); | 209 | (int) GELF_R_TYPE (rela->r_info)); |
206 | @@ -418,6 +555,7 @@ | 210 | @@ -418,6 +555,7 @@ arm_rel_to_rela (DSO *dso, GElf_Rel *rel |
207 | abort (); | 211 | abort (); |
208 | case R_ARM_RELATIVE: | 212 | case R_ARM_RELATIVE: |
209 | case R_ARM_ABS32: | 213 | case R_ARM_ABS32: |
@@ -211,7 +215,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
211 | rela->r_addend = (Elf32_Sword) read_ule32 (dso, rel->r_offset); | 215 | rela->r_addend = (Elf32_Sword) read_ule32 (dso, rel->r_offset); |
212 | break; | 216 | break; |
213 | case R_ARM_PC24: | 217 | case R_ARM_PC24: |
214 | @@ -426,6 +564,8 @@ | 218 | @@ -426,6 +564,8 @@ arm_rel_to_rela (DSO *dso, GElf_Rel *rel |
215 | break; | 219 | break; |
216 | case R_ARM_COPY: | 220 | case R_ARM_COPY: |
217 | case R_ARM_GLOB_DAT: | 221 | case R_ARM_GLOB_DAT: |
@@ -220,7 +224,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
220 | rela->r_addend = 0; | 224 | rela->r_addend = 0; |
221 | break; | 225 | break; |
222 | } | 226 | } |
223 | @@ -445,6 +585,7 @@ | 227 | @@ -445,6 +585,7 @@ arm_rela_to_rel (DSO *dso, GElf_Rela *re |
224 | abort (); | 228 | abort (); |
225 | case R_ARM_RELATIVE: | 229 | case R_ARM_RELATIVE: |
226 | case R_ARM_ABS32: | 230 | case R_ARM_ABS32: |
@@ -228,7 +232,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
228 | write_le32 (dso, rela->r_offset, rela->r_addend); | 232 | write_le32 (dso, rela->r_offset, rela->r_addend); |
229 | break; | 233 | break; |
230 | case R_ARM_PC24: | 234 | case R_ARM_PC24: |
231 | @@ -453,6 +594,8 @@ | 235 | @@ -453,6 +594,8 @@ arm_rela_to_rel (DSO *dso, GElf_Rela *re |
232 | | ((rela->r_addend >> 2) & 0xffffff)); | 236 | | ((rela->r_addend >> 2) & 0xffffff)); |
233 | break; | 237 | break; |
234 | case R_ARM_GLOB_DAT: | 238 | case R_ARM_GLOB_DAT: |
@@ -237,7 +241,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
237 | write_le32 (dso, rela->r_offset, 0); | 241 | write_le32 (dso, rela->r_offset, 0); |
238 | break; | 242 | break; |
239 | } | 243 | } |
240 | @@ -488,6 +631,13 @@ | 244 | @@ -488,6 +631,13 @@ arm_need_rel_to_rela (DSO *dso, int firs |
241 | /* FALLTHROUGH */ | 245 | /* FALLTHROUGH */ |
242 | case R_ARM_PC24: | 246 | case R_ARM_PC24: |
243 | return 1; | 247 | return 1; |
@@ -251,7 +255,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
251 | } | 255 | } |
252 | } | 256 | } |
253 | } | 257 | } |
254 | @@ -612,6 +762,12 @@ | 258 | @@ -612,6 +762,12 @@ arm_undo_prelink_rel (DSO *dso, GElf_Rel |
255 | return 0; | 259 | return 0; |
256 | error (0, 0, "%s: R_ARM_COPY reloc in shared library?", dso->filename); | 260 | error (0, 0, "%s: R_ARM_COPY reloc in shared library?", dso->filename); |
257 | return 1; | 261 | return 1; |
@@ -264,7 +268,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
264 | default: | 268 | default: |
265 | error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, | 269 | error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, |
266 | (int) GELF_R_TYPE (rel->r_info)); | 270 | (int) GELF_R_TYPE (rel->r_info)); |
267 | @@ -634,6 +790,10 @@ | 271 | @@ -634,6 +790,10 @@ arm_reloc_class (int reloc_type) |
268 | { | 272 | { |
269 | case R_ARM_COPY: return RTYPE_CLASS_COPY; | 273 | case R_ARM_COPY: return RTYPE_CLASS_COPY; |
270 | case R_ARM_JUMP_SLOT: return RTYPE_CLASS_PLT; | 274 | case R_ARM_JUMP_SLOT: return RTYPE_CLASS_PLT; |
@@ -275,7 +279,7 @@ Index: prelink-0.0.20050901/src/arch-arm.c | |||
275 | default: return RTYPE_CLASS_VALID; | 279 | default: return RTYPE_CLASS_VALID; |
276 | } | 280 | } |
277 | } | 281 | } |
278 | @@ -646,7 +806,7 @@ | 282 | @@ -646,7 +806,7 @@ PL_ARCH = { |
279 | .R_JMP_SLOT = R_ARM_JUMP_SLOT, | 283 | .R_JMP_SLOT = R_ARM_JUMP_SLOT, |
280 | .R_COPY = R_ARM_COPY, | 284 | .R_COPY = R_ARM_COPY, |
281 | .R_RELATIVE = R_ARM_RELATIVE, | 285 | .R_RELATIVE = R_ARM_RELATIVE, |
diff --git a/meta/packages/prelink/prelink_20061027.bb b/meta/packages/prelink/prelink_20061027.bb index a83ff1b61f..e00b9fd7d7 100644 --- a/meta/packages/prelink/prelink_20061027.bb +++ b/meta/packages/prelink/prelink_20061027.bb | |||
@@ -4,7 +4,7 @@ DESCRIPTION = " The prelink package contains a utility which modifies ELF shared | |||
4 | and executables, so that far fewer relocations need to be resolved at \ | 4 | and executables, so that far fewer relocations need to be resolved at \ |
5 | runtime and thus programs come up faster." | 5 | runtime and thus programs come up faster." |
6 | LICENSE = "GPL" | 6 | LICENSE = "GPL" |
7 | PR = "r2" | 7 | PR = "r3" |
8 | 8 | ||
9 | SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \ | 9 | SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \ |
10 | file://prelink.conf \ | 10 | file://prelink.conf \ |