mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-13 17:57:12 +08:00
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>
This commit is contained in:
parent
0a20bcfaf1
commit
7f1315070e
@ -1084,7 +1084,7 @@ static void elf_out(int32_t segto, const void *data,
|
|||||||
"Unsupported non-32-bit ELF relocation [2]");
|
"Unsupported non-32-bit ELF relocation [2]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elf_sect_writeaddr(s, addr, size);
|
elf_sect_writeaddr(s, addr, 2);
|
||||||
} else if (type == OUT_REL4ADR) {
|
} else if (type == OUT_REL4ADR) {
|
||||||
addr = *(int64_t *)data;
|
addr = *(int64_t *)data;
|
||||||
if (segment == segto)
|
if (segment == segto)
|
||||||
@ -1117,7 +1117,7 @@ static void elf_out(int32_t segto, const void *data,
|
|||||||
" use of WRT");
|
" use of WRT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elf_sect_writeaddr(s, addr, size);
|
elf_sect_writeaddr(s, addr, 4);
|
||||||
} else if (type == OUT_REL8ADR) {
|
} else if (type == OUT_REL8ADR) {
|
||||||
addr = *(int64_t *)data;
|
addr = *(int64_t *)data;
|
||||||
if (segment == segto)
|
if (segment == segto)
|
||||||
@ -1145,7 +1145,7 @@ static void elf_out(int32_t segto, const void *data,
|
|||||||
" use of WRT");
|
" use of WRT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elf_sect_writeaddr(s, addr, size);
|
elf_sect_writeaddr(s, addr, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user