output: maco 64 -- Fix data conversion

Looks like were a typo in first place

http://bugzilla.nasm.us/show_bug.cgi?id=3392298

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2015-01-11 17:21:46 +03:00
parent 78f477b35f
commit d4923fc6a2

View File

@ -598,7 +598,7 @@ static void macho_output(int32_t secto, const void *data,
" section base references");
} else {
if (wrt == NO_SEG) {
*mydata -= add_reloc(s, section, 1, 4, (int64_t)*mydata); // X86_64_RELOC_SIGNED/BRANCH
*mydata -= add_reloc(s, section, 1, 4, *(int64_t *)mydata); // X86_64_RELOC_SIGNED/BRANCH
} else if (wrt == macho_gotpcrel_sect) {
if (s->data->datalen > 1) {
saa_fread(s->data, s->data->datalen-2, &gotload, 1); // Retrieve Instruction Opcode
@ -606,9 +606,9 @@ static void macho_output(int32_t secto, const void *data,
gotload = 0;
}
if (gotload == 0x8B) { // Check for MOVQ Opcode
*mydata -= add_reloc(s, section, 4, 4, (int64_t)*mydata); // X86_64_GOT_LOAD (MOVQ load)
*mydata -= add_reloc(s, section, 4, 4, *(int64_t *)mydata); // X86_64_GOT_LOAD (MOVQ load)
} else {
*mydata -= add_reloc(s, section, 3, 4, (int64_t)*mydata); // X86_64_GOT
*mydata -= add_reloc(s, section, 3, 4, *(int64_t *)mydata); // X86_64_GOT
}
} else {
nasm_error(ERR_NONFATAL, "Mach-O format does not support"