Mercurial > hg > xemacs-beta
comparison src/unexcw.c @ 263:727739f917cb r20-5b30
Import from CVS: tag r20-5b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:24:41 +0200 |
parents | 677f6a0ee643 |
children | b2472a1930f2 |
comparison
equal
deleted
inserted
replaced
262:9d8607af9e13 | 263:727739f917cb |
---|---|
197 data_size = (unsigned long)my_edata - (unsigned long)data_start_va; | 197 data_size = (unsigned long)my_edata - (unsigned long)data_start_va; |
198 | 198 |
199 /* The .idata section. */ | 199 /* The .idata section. */ |
200 if (read (a_out, &f_idata, sizeof (f_idata)) != sizeof (f_idata) | 200 if (read (a_out, &f_idata, sizeof (f_idata)) != sizeof (f_idata) |
201 && | 201 && |
202 strcmp (f_idata.s_name, ".idata")) | 202 strcmp (f_idata.s_name, ".rdata")) |
203 { | 203 { |
204 PERROR ("no .idata section"); | 204 PERROR ("no .idata section"); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
236 new_data_size=f_ohdr.dsize + new_bss_size; | 236 new_data_size=f_ohdr.dsize + new_bss_size; |
237 f_data_s_scnptr = f_data.s_scnptr; | 237 f_data_s_scnptr = f_data.s_scnptr; |
238 f_data_s_vaddr = f_data.s_vaddr; | 238 f_data_s_vaddr = f_data.s_vaddr; |
239 f_data.s_vaddr = f_bss.s_vaddr; | 239 f_data.s_vaddr = f_bss.s_vaddr; |
240 f_data.s_paddr += new_bss_size; | 240 f_data.s_paddr += new_bss_size; |
241 | 241 #if 0 |
242 if (f_data.s_size + f_idata.s_size != f_ohdr.dsize) | 242 if (f_data.s_size + f_idata.s_size != f_ohdr.dsize) |
243 { | 243 { |
244 printf("section size doesn't tally with dsize %lx != %lx\n", | 244 printf("section size doesn't tally with dsize %lx != %lx\n", |
245 f_data.s_size + f_idata.s_size, f_ohdr.dsize); | 245 f_data.s_size + f_idata.s_size, f_ohdr.dsize); |
246 } | 246 } |
247 #endif | |
247 f_data.s_size += new_bss_size; | 248 f_data.s_size += new_bss_size; |
248 lseek (a_new, 0, SEEK_SET); | 249 lseek (a_new, 0, SEEK_SET); |
249 /* write file header */ | 250 /* write file header */ |
250 f_hdr.f_symptr += file_sz_change; | 251 f_hdr.f_symptr += file_sz_change; |
251 f_hdr.f_nscns--; | 252 f_hdr.f_nscns--; |
281 | 282 |
282 if (write(a_new, &f_data, sizeof(f_data)) != sizeof(f_data)) | 283 if (write(a_new, &f_data, sizeof(f_data)) != sizeof(f_data)) |
283 { | 284 { |
284 PERROR("failed to write data header"); | 285 PERROR("failed to write data header"); |
285 } | 286 } |
286 | 287 |
287 printf("writing .idata header\n"); | 288 printf("writing .idata header\n"); |
288 f_idata.s_scnptr += file_sz_change; | 289 f_idata.s_scnptr += file_sz_change; |
289 if (f_idata.s_lnnoptr != 0) f_idata.s_lnnoptr += file_sz_change; | 290 if (f_idata.s_lnnoptr != 0) f_idata.s_lnnoptr += file_sz_change; |
290 if (f_idata.s_relptr != 0) f_idata.s_relptr += file_sz_change; | 291 if (f_idata.s_relptr != 0) f_idata.s_relptr += file_sz_change; |
291 if (write(a_new, &f_idata, sizeof(f_idata)) != sizeof(f_idata)) | 292 if (write(a_new, &f_idata, sizeof(f_idata)) != sizeof(f_idata)) |
292 { | 293 { |
293 PERROR("failed to write idata header"); | 294 PERROR("failed to write idata header"); |
294 } | 295 } |
295 | 296 |
296 /* copy other section headers adjusting the file offset */ | 297 /* copy other section headers adjusting the file offset */ |
297 for (i=0; i<(f_hdr.f_nscns-3); i++) | 298 for (i=0; i<(f_hdr.f_nscns-3); i++) |
298 { | 299 { |
299 if (read (a_out, §ion, sizeof (section)) != sizeof (section)) | 300 if (read (a_out, §ion, sizeof (section)) != sizeof (section)) |
300 { | 301 { |