version 1.3, 2003/04/15 08:33:34 |
version 1.4, 2003/06/10 22:20:46 |
|
|
unsigned long gap = ph[i].p_vaddr - cur_vma; |
unsigned long gap = ph[i].p_vaddr - cur_vma; |
char obuf[1024]; |
char obuf[1024]; |
if (gap > 65536) { |
if (gap > 65536) { |
fprintf(stderr, "Intersegment gap (%d bytes) too large.\n", |
fprintf(stderr, |
gap); |
"Intersegment gap (%d bytes) too large.\n", |
|
gap); |
exit(1); |
exit(1); |
} |
} |
fprintf(stderr, "Warning: %d byte intersegment gap.\n", gap); |
fprintf(stderr, |
|
"Warning: %d byte intersegment gap.\n", gap); |
memset(obuf, 0, sizeof obuf); |
memset(obuf, 0, sizeof obuf); |
while (gap) { |
while (gap) { |
int count = write(outfile, obuf, |
int count = write(outfile, obuf, |
|
|
exit(0); |
exit(0); |
} |
} |
|
|
copy(out, in, offset, size) |
void |
int out, in; |
copy(int out, int in, off_t offset, off_t size) |
off_t offset, size; |
|
{ |
{ |
char ibuf[4096]; |
char ibuf[4096]; |
int remaining, cur, count; |
int remaining, cur, count; |
|
|
* Combine two segments, which must be contiguous. If pad is true, it's |
* Combine two segments, which must be contiguous. If pad is true, it's |
* okay for there to be padding between. |
* okay for there to be padding between. |
*/ |
*/ |
combine(base, new, pad) |
void |
struct sect *base, *new; |
combine(struct sect *base, struct sect *new, int pad) |
int pad; |
|
{ |
{ |
if (!base->len) |
if (!base->len) |
*base = *new; |
*base = *new; |
|
|
} |
} |
} |
} |
|
|
phcmp(h1, h2) |
int |
Elf32_Phdr *h1, *h2; |
phcmp(Elf32_Phdr *h1, Elf32_Phdr *h2) |
{ |
{ |
if (h1->p_vaddr > h2->p_vaddr) |
if (h1->p_vaddr > h2->p_vaddr) |
return 1; |
return 1; |
|
|
return 0; |
return 0; |
} |
} |
|
|
char * |
char * |
saveRead(int file, off_t offset, off_t len, char *name) |
saveRead(int file, off_t offset, off_t len, char *name) |
{ |
{ |
char *tmp; |
char *tmp; |