summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-17 23:30:54 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-17 23:30:54 -0700
commit7f1315070e6ac38d4194cc333b391dcecf6f0053 (patch)
tree5fa845b4095550d0f66091e97e9eced73c356d22
parent0a20bcfaf17fc78e97fc609bb60087529df79eea (diff)
downloadnasm-7f1315070e6ac38d4194cc333b391dcecf6f0053.tar.gz
ELF64: the "size" argument to OUT_REL*ADR isn't really the size
The "size" argument to the OUT_REL*ADR output types is actually intra-instruction offset, not the actual size. Thus, emit the size properly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--output/outelf64.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/output/outelf64.c b/output/outelf64.c
index f6dc6172..3dfa8ba2 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -1084,7 +1084,7 @@ static void elf_out(int32_t segto, const void *data,
"Unsupported non-32-bit ELF relocation [2]");
}
}
- elf_sect_writeaddr(s, addr, size);
+ elf_sect_writeaddr(s, addr, 2);
} else if (type == OUT_REL4ADR) {
addr = *(int64_t *)data;
if (segment == segto)
@@ -1117,7 +1117,7 @@ static void elf_out(int32_t segto, const void *data,
" use of WRT");
}
}
- elf_sect_writeaddr(s, addr, size);
+ elf_sect_writeaddr(s, addr, 4);
} else if (type == OUT_REL8ADR) {
addr = *(int64_t *)data;
if (segment == segto)
@@ -1145,7 +1145,7 @@ static void elf_out(int32_t segto, const void *data,
" use of WRT");
}
}
- elf_sect_writeaddr(s, addr, size);
+ elf_sect_writeaddr(s, addr, 8);
}
}