I am writing a compiler that outputs for NASM. I have the compiler working for 32-bit windows and linux, I have 64-bit linux working and I am trying to get 64-bit windows working.
I have an issue with linking, it's a warning but I want to fix it and not ignore it. For some reason, even though I have default rel in both files (also tried default abs), the label is incorrectly refered to as a 32-bit address (waning below)
java.lang.Object.obj : error LNK2017: 'ADDR32' relocation to 'int__array@SIT' invalid without /LARGEADDRESSAWARE:NO
file 1
default rel
bits 64
section .data
global int__array@SIT
int__array@SIT:
file 2:
default rel
bits 64
.text
...
extern int__array@SIT
mov qword [rax], int__array@SIT
...
In the nasm manual, it does not seem like this should be the case. (
http://www.nasm.us/doc/nasmdo11.html) section 11.2
"mov rax,foo ; 64-bit immediate" why is int__array@SIT not 64 bit? I have tried adding qword in front but there was no change.
Any help would be greatly appreciated.