# HG changeset patch # User Richard M. Stallman # Date 840473615 0 # Node ID 67d9f8e91688fa14c2d715ad4c4a7009eab1d720 # Parent ea80dae13b2f2404144fd378d3443c1014e8d2a7 (unexec): Copy the .got section. diff -r ea80dae13b2f -r 67d9f8e91688 src/unexalpha.c --- a/src/unexalpha.c Mon Aug 19 16:31:27 1996 +0000 +++ b/src/unexalpha.c Mon Aug 19 16:53:35 1996 +0000 @@ -266,6 +266,8 @@ #ifdef _GOT if (got_section != NULL) { + bcopy (got_section, buffer, sizeof (struct scnhdr)); + got_section->s_vaddr = vaddr; got_section->s_paddr = vaddr; got_section->s_size = 0; @@ -292,6 +294,21 @@ WRITE (new, (char *)DATA_START, nhdr.aout.dsize, "writing data section to %s", new_name); +#ifdef _GOT +#define old_got_section ((struct scnhdr *)buffer) + + if (got_section != NULL) + { + SEEK (new, old_got_section->s_scnptr, + "seeking to start of got_section in %s", new_name); + WRITE (new, oldptr + old_got_section->s_scnptr, old_got_section->s_size, + "writing new got_section of %s", new_name); + SEEK (new, nhdr.aout.tsize + nhdr.aout.dsize, + "seeking to end of data section of %s", new_name); + } + +#undef old_got_section +#endif /* * Construct new symbol table header