I am trying to link 64-bit code with the windows x64 linker v9.00.21022.08
and yasm however yasm appears to be using 32bit pointers for external variables and the linker doesn't like this.
the only way to make yasm do 64-bit pointers is to have qword proseding the symbol in every use of it
e.g
Code: Select all
mov rax, qword a
add rdx, a
whilst
makes it a 64-bit addressmov rax, qword a
add rdx, qword a
there are some instructions where it is not possible to do this
is there a way around this?
normally I wouldn't care but my linker throws errors
i tried using /LARGEADDRESSAWARE:NO but it is not suported with /driver which I read is required for OS devstart.obj : error LNK2017: 'ADDR32' relocation to 'idtp' invalid without /LARGEADDRESSAWARE:NO
start.obj : error LNK2017: 'ADDR32' relocation to 'aportid' invalid without /LARGEADDRESSAWARE:NO
start.obj : error LNK2017: 'ADDR32' relocation to 'aportid' invalid without /LARGEADDRESSAWARE:NO
it only complains about the symbols that dumpbin says are in the relocation section and are of type ADDR32
the ones that are of type ADDR64 have qword proseding them in every reference in the overs it is not possible for me to do that
Code: Select all
RELOCATIONS #1
Symbol Symbol
Offset Type Applied To Index Name
-------- ---------------- ----------------- -------- ------
00000002 ADDR64 00000000 00000000 5 System_get_New_Stack
0000000D REL32 00000000 8 main
00000013 ADDR64 00000000 00000000 4 System_get_New_Address
0000001D ADDR64 00000000 00000000 B idtp
0000002A ADDR32 00000000 B idtp
00000150 ADDR64 00000000 00000000 2D fault_handler
00000178 ADDR32 00000000 2E aportid
0000017F ADDR64 00000000 00000000 2F res
00000189 ADDR64 00000000 00000000 31 avalue
00000195 ADDR32 00000000 2E aportid
i have also noticed when i pt qword before it in some uses and not others it says it is both 64bit and 32bit!
if anyone could tell me how to fix this i would be very great full
thanks for any help
PS my yasm command line is
Code: Select all
yasm -Xvc -f win64 -m amd64 --force-strict -o \intermediate\start.obj -rnasm -pnasm start.asm