summaryrefslogtreecommitdiff
path: root/src/unexalpha.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-08-19 16:53:35 +0000
committerRichard M. Stallman <rms@gnu.org>1996-08-19 16:53:35 +0000
commit7d7134484ace48209757c4df34685e684a94a408 (patch)
tree21be42765c9968972b3eafb6173d2dca0f905062 /src/unexalpha.c
parent3c5ddb48c40fcf125d5b42932fb7cf2453314595 (diff)
downloademacs-7d7134484ace48209757c4df34685e684a94a408.tar.gz
(unexec): Copy the .got section.
Diffstat (limited to 'src/unexalpha.c')
-rw-r--r--src/unexalpha.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/unexalpha.c b/src/unexalpha.c
index 2bbffde05ab..48b4059fcaf 100644
--- a/src/unexalpha.c
+++ b/src/unexalpha.c
@@ -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