]> git.eshelyaron.com Git - emacs.git/commitdiff
(unexec): Copy the .got section.
authorRichard M. Stallman <rms@gnu.org>
Mon, 19 Aug 1996 16:53:35 +0000 (16:53 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 19 Aug 1996 16:53:35 +0000 (16:53 +0000)
src/unexalpha.c

index 2bbffde05ab3eda0bf30a9f65f5c448fe30e320e..48b4059fcaf797a7b878b074444f94331f688427 100644 (file)
@@ -266,6 +266,8 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
 #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 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
   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