Mercurial > hg > chrpath
annotate chrpath.c @ 2:7bf4a164d5bb default tip
fix bug: long_options have to be zero terminated
author | Peter Meerwald <p.meerwald@bct-electronic.com> |
---|---|
date | Fri, 20 Jul 2012 11:28:30 +0200 |
parents | bbbfb3f97919 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 <URL:http://gcc.gnu.org/ml/gcc/1999-04n/msg01105.html> | |
3 | |
4 Re: changing embedded RPATH in existing executables. | |
5 | |
6 To: geoffk@ozemail.com.au | |
7 Subject: Re: changing embedded RPATH in existing executables. | |
8 From: <peeter_joot@VNET.IBM.COM> (peeter joot) | |
9 Date: Fri, 30 Apr 1999 16:14:44 -0400 (EDT) | |
10 Cc: peeterj@ca.ibm.com, egcs@cygnus.com, libc-hacker@cygnus.com, linux-gcc@vger.rutgers.edu | |
11 Reply-To: <peeter_joot@VNET.IBM.COM> | |
12 | |
13 > _Changing_ is a little tricky, but the attached program strips rpaths | |
14 > from executables (I find it essential for debugging the binutils). | |
15 > It's endian-dependent, if you want this for x86 you can just change | |
16 > the occurrences of 'MSB' to 'LSB' and compile (I should really fix | |
17 > that). | |
18 | |
19 Hi Geoff, | |
20 | |
21 With your program as a guide (and some peeks into libbfd, elf.h, a bit | |
22 of the glibc dynamic loader code, objdump, and a hex-editor) I was able to | |
23 figure out enough to find and change the rpath string. That was fun! | |
24 | |
25 This program assumes (unlike your original program) that there is only | |
26 one DT_RPATH tag in the dynamic section as even with multiple '-Wl,-rpath,' | |
27 commands in the link this seems to occur (they all get concatonated into | |
28 a : separated path). | |
29 | |
30 Thanks for your help. If you want to use this on non-x86 you have to change | |
31 the occurances of LSB back to MSB:) | |
32 | |
33 Peeter | |
34 -- | |
35 */ | |
36 | |
37 #ifdef HAVE_CONFIG_H | |
38 # include "config.h" | |
39 #endif | |
40 | |
41 #include <stdio.h> | |
42 #include <unistd.h> | |
43 #include <fcntl.h> | |
44 #include <elf.h> | |
45 #if defined(HAVE_LINK_H) | |
46 # include <link.h> | |
47 #endif /* HAVE_LINK_H */ | |
48 #include <stdlib.h> | |
49 #include <string.h> | |
50 #include <sys/stat.h> | |
51 #include "protos.h" | |
52 | |
53 /** | |
54 * Reads an ELF file, and reads or alters the RPATH setting. | |
55 * | |
56 * TODO: | |
57 * modify to add RPATH setting if none exists. | |
58 */ | |
59 | |
60 | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
61 static int |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
62 chrpath32(int fd, const char *filename, const char *newpath, Elf32_Ehdr *ehdr, int convert) { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
63 Elf32_Phdr phdr; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
64 Elf32_Shdr shdr; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
65 Elf32_Dyn *dyns; |
0 | 66 int i; |
67 int rpathoff; | |
68 char * strtab; | |
69 char * rpath; | |
70 unsigned int rpathlen; | |
71 int rpath_dyns_index; | |
72 | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
73 if (0 != elf32_find_dynamic_section(fd, ehdr, &phdr)) |
0 | 74 { |
75 perror("found no dynamic section"); | |
76 return 1; | |
77 } | |
78 | |
79 dyns = malloc(phdr.p_filesz); | |
80 if (dyns == NULL) | |
81 { | |
82 perror ("allocating memory for dynamic section"); | |
83 return 1; | |
84 } | |
85 memset(dyns, 0, phdr.p_filesz); | |
86 if (lseek(fd, phdr.p_offset, SEEK_SET) == -1 | |
87 || read(fd, dyns, phdr.p_filesz) != (int)phdr.p_filesz) | |
88 { | |
89 perror ("reading dynamic section"); | |
90 free(dyns); | |
91 return 1; | |
92 } | |
93 | |
94 rpathoff = -1; | |
95 for ( rpath_dyns_index = 0; dyns[rpath_dyns_index].d_tag != DT_NULL; | |
96 ++rpath_dyns_index ) | |
97 { | |
98 if ( elf_dynpath_tag(dyns[rpath_dyns_index].d_tag) ) | |
99 { | |
100 rpathoff = dyns[rpath_dyns_index].d_un.d_ptr; | |
101 break; | |
102 } | |
103 } | |
104 if (rpathoff == -1) | |
105 { | |
106 printf("%s: no rpath or runpath tag found.\n", filename); | |
107 free(dyns); | |
108 return 2; | |
109 } | |
110 | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
111 if (lseek(fd, ehdr->e_shoff, SEEK_SET) == -1) |
0 | 112 { |
113 perror ("positioning for sections"); | |
114 free(dyns); | |
115 return 1; | |
116 } | |
117 | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
118 for (i = 0; i < ehdr->e_shnum; i++) |
0 | 119 { |
120 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr)) | |
121 { | |
122 perror ("reading section header"); | |
123 free(dyns); | |
124 return 1; | |
125 } | |
126 if (shdr.sh_type == SHT_STRTAB) | |
127 break; | |
128 } | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
129 if (i == ehdr->e_shnum) |
0 | 130 { |
131 fprintf (stderr, "No string table found.\n"); | |
132 free(dyns); | |
133 return 2; | |
134 } | |
135 strtab = (char *)malloc(shdr.sh_size); | |
136 if (strtab == NULL) | |
137 { | |
138 perror ("allocating memory for string table"); | |
139 free(dyns); | |
140 return 1; | |
141 } | |
142 memset(strtab, 0, shdr.sh_size); | |
143 | |
144 if (lseek(fd, shdr.sh_offset, SEEK_SET) == -1) | |
145 { | |
146 perror ("positioning for string table"); | |
147 free(strtab); | |
148 free(dyns); | |
149 return 1; | |
150 } | |
151 if (read(fd, strtab, shdr.sh_size) != (int)shdr.sh_size) | |
152 { | |
153 perror ("reading string table"); | |
154 free(strtab); | |
155 free(dyns); | |
156 return 1; | |
157 } | |
158 | |
159 if ((int)shdr.sh_size < rpathoff) | |
160 { | |
161 fprintf(stderr, "%s string offset not contained in string table", | |
162 elf_tagname(dyns[rpath_dyns_index].d_tag)); | |
163 free(strtab); | |
164 free(dyns); | |
165 return 5; | |
166 } | |
167 rpath = strtab+rpathoff; | |
168 | |
169 #if defined(DT_RUNPATH) | |
170 if (convert && dyns[rpath_dyns_index].d_tag == DT_RPATH) | |
171 { | |
172 dyns[rpath_dyns_index].d_tag = DT_RUNPATH; | |
173 if (lseek(fd, phdr.p_offset, SEEK_SET) == -1 | |
174 || write(fd, dyns, phdr.p_filesz) != (int)phdr.p_filesz) | |
175 { | |
176 perror ("converting RPATH to RUNPATH"); | |
177 return 1; | |
178 } | |
179 printf("%s: RPATH converted to RUNPATH\n", filename); | |
180 } | |
181 #endif /* DT_RUNPATH */ | |
182 | |
183 printf("%s: %s=%s\n", filename, elf_tagname(dyns[rpath_dyns_index].d_tag), | |
184 rpath); | |
185 | |
186 if (NULL == newpath) | |
187 { | |
188 free(dyns); | |
189 free(strtab); | |
190 return 0; | |
191 } | |
192 | |
193 rpathlen = strlen(rpath); | |
194 | |
195 /* | |
196 * Calculate the maximum rpath length (will be equal to rpathlen unless | |
197 * we have previously truncated it). | |
198 */ | |
199 for ( i = rpathoff + rpathlen ; (i < (int)shdr.sh_size | |
200 && strtab[i] == '\0') ; i++ ) | |
201 ; | |
202 i--; | |
203 | |
204 if (i > (int)(rpathoff + rpathlen)) | |
205 rpathlen = i - rpathoff; | |
206 | |
207 if (strlen(newpath) > rpathlen) | |
208 { | |
209 fprintf(stderr, "new rpath '%s' too large; maximum length %i\n", | |
210 newpath, rpathlen); | |
211 free(dyns); | |
212 free(strtab); | |
213 return 7; | |
214 } | |
215 | |
216 memset(rpath, 0, rpathlen); | |
217 strcpy(rpath, newpath); | |
218 | |
219 if (lseek(fd, shdr.sh_offset+rpathoff, SEEK_SET) == -1) | |
220 { | |
221 perror ("positioning for RPATH"); | |
222 free(dyns); | |
223 free(strtab); | |
224 return 1; | |
225 } | |
226 if (write(fd, rpath, rpathlen) != (int)rpathlen) | |
227 { | |
228 perror ("writing RPATH"); | |
229 free(dyns); | |
230 free(strtab); | |
231 return 1; | |
232 } | |
233 printf("%s: new %s: %s\n", filename, | |
234 elf_tagname(dyns[rpath_dyns_index].d_tag), rpath); | |
235 | |
236 elf_close(fd); | |
237 | |
238 free(dyns); | |
239 dyns = NULL; | |
240 | |
241 free(strtab); | |
242 | |
243 return 0; | |
244 } | |
1
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
245 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
246 static int |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
247 chrpath64(int fd, const char *filename, const char *newpath, Elf64_Ehdr *ehdr, int convert) { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
248 Elf64_Phdr phdr; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
249 Elf64_Shdr shdr; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
250 Elf64_Dyn *dyns; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
251 int i; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
252 int rpathoff; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
253 char * strtab; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
254 char * rpath; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
255 unsigned int rpathlen; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
256 int rpath_dyns_index; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
257 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
258 if (0 != elf64_find_dynamic_section(fd, ehdr, &phdr)) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
259 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
260 perror("found no dynamic section"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
261 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
262 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
263 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
264 dyns = malloc(phdr.p_filesz); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
265 if (dyns == NULL) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
266 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
267 perror ("allocating memory for dynamic section"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
268 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
269 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
270 memset(dyns, 0, phdr.p_filesz); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
271 if (lseek(fd, phdr.p_offset, SEEK_SET) == -1 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
272 || read(fd, dyns, phdr.p_filesz) != (int)phdr.p_filesz) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
273 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
274 perror ("reading dynamic section"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
275 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
276 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
277 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
278 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
279 rpathoff = -1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
280 for ( rpath_dyns_index = 0; dyns[rpath_dyns_index].d_tag != DT_NULL; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
281 ++rpath_dyns_index ) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
282 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
283 if ( elf_dynpath_tag(dyns[rpath_dyns_index].d_tag) ) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
284 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
285 rpathoff = dyns[rpath_dyns_index].d_un.d_ptr; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
286 break; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
287 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
288 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
289 if (rpathoff == -1) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
290 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
291 printf("%s: no rpath or runpath tag found.\n", filename); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
292 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
293 return 2; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
294 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
295 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
296 if (lseek(fd, ehdr->e_shoff, SEEK_SET) == -1) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
297 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
298 perror ("positioning for sections"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
299 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
300 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
301 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
302 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
303 for (i = 0; i < ehdr->e_shnum; i++) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
304 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
305 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr)) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
306 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
307 perror ("reading section header"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
308 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
309 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
310 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
311 if (shdr.sh_type == SHT_STRTAB) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
312 break; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
313 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
314 if (i == ehdr->e_shnum) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
315 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
316 fprintf (stderr, "No string table found.\n"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
317 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
318 return 2; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
319 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
320 strtab = (char *)malloc(shdr.sh_size); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
321 if (strtab == NULL) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
322 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
323 perror ("allocating memory for string table"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
324 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
325 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
326 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
327 memset(strtab, 0, shdr.sh_size); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
328 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
329 if (lseek(fd, shdr.sh_offset, SEEK_SET) == -1) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
330 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
331 perror ("positioning for string table"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
332 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
333 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
334 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
335 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
336 if (read(fd, strtab, shdr.sh_size) != (int)shdr.sh_size) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
337 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
338 perror ("reading string table"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
339 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
340 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
341 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
342 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
343 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
344 if ((int)shdr.sh_size < rpathoff) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
345 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
346 fprintf(stderr, "%s string offset not contained in string table", |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
347 elf_tagname(dyns[rpath_dyns_index].d_tag)); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
348 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
349 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
350 return 5; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
351 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
352 rpath = strtab+rpathoff; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
353 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
354 #if defined(DT_RUNPATH) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
355 if (convert && dyns[rpath_dyns_index].d_tag == DT_RPATH) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
356 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
357 dyns[rpath_dyns_index].d_tag = DT_RUNPATH; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
358 if (lseek(fd, phdr.p_offset, SEEK_SET) == -1 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
359 || write(fd, dyns, phdr.p_filesz) != (int)phdr.p_filesz) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
360 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
361 perror ("converting RPATH to RUNPATH"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
362 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
363 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
364 printf("%s: RPATH converted to RUNPATH\n", filename); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
365 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
366 #endif /* DT_RUNPATH */ |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
367 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
368 printf("%s: %s=%s\n", filename, elf_tagname(dyns[rpath_dyns_index].d_tag), |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
369 rpath); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
370 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
371 if (NULL == newpath) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
372 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
373 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
374 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
375 return 0; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
376 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
377 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
378 rpathlen = strlen(rpath); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
379 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
380 /* |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
381 * Calculate the maximum rpath length (will be equal to rpathlen unless |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
382 * we have previously truncated it). |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
383 */ |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
384 for ( i = rpathoff + rpathlen ; (i < (int)shdr.sh_size |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
385 && strtab[i] == '\0') ; i++ ) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
386 ; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
387 i--; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
388 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
389 if (i > (int)(rpathoff + rpathlen)) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
390 rpathlen = i - rpathoff; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
391 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
392 if (strlen(newpath) > rpathlen) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
393 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
394 fprintf(stderr, "new rpath '%s' too large; maximum length %i\n", |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
395 newpath, rpathlen); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
396 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
397 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
398 return 7; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
399 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
400 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
401 memset(rpath, 0, rpathlen); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
402 strcpy(rpath, newpath); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
403 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
404 if (lseek(fd, shdr.sh_offset+rpathoff, SEEK_SET) == -1) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
405 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
406 perror ("positioning for RPATH"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
407 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
408 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
409 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
410 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
411 if (write(fd, rpath, rpathlen) != (int)rpathlen) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
412 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
413 perror ("writing RPATH"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
414 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
415 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
416 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
417 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
418 printf("%s: new %s: %s\n", filename, |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
419 elf_tagname(dyns[rpath_dyns_index].d_tag), rpath); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
420 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
421 elf_close(fd); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
422 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
423 free(dyns); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
424 dyns = NULL; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
425 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
426 free(strtab); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
427 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
428 return 0; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
429 } |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
430 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
431 int |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
432 chrpath(const char *filename, const char *newpath, int convert) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
433 { |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
434 int fd; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
435 Elf32_Ehdr ehdr32; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
436 Elf64_Ehdr ehdr64; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
437 int oflags; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
438 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
439 if (NULL == newpath && 0 == convert) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
440 oflags = O_RDONLY; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
441 else |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
442 oflags = O_RDWR; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
443 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
444 fd = elf32_open(filename, oflags, &ehdr32); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
445 if (fd >= 0) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
446 return chrpath32(fd, filename, newpath, &ehdr32, convert); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
447 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
448 fd = elf64_open(filename, oflags, &ehdr64); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
449 if (fd >= 0) |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
450 return chrpath64(fd, filename, newpath, &ehdr64, convert); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
451 |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
452 perror ("elf_open"); |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
453 return 1; |
bbbfb3f97919
implement 32 and 64 bit support
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
0
diff
changeset
|
454 } |