I'm currently using Nasm and LD (part of gcc) as linker, and am interested in switching to Golink.
But I want to clarify how Golink deals with imported function names from DLLs. Take this code (in Nasm syntax):
segment .text
global main
main:
sub rsp,32
mov rcx,KK14
extern puts
call puts
add rsp,32
mov rax,0
ret
segment .data
align 8
KK14:
db 'Hi There!',0
This works with both LD and Golink. But now take that 'call puts' and make it indirect:
mov rax, puts
call rax
In this form, it works as expected with LD, but not Golink. With Golink, I have to write it like this:
mov rax, puts
call [rax]
with an extra level of indirection. Can someone please confirm that this is the case? There was mention of something along these lines in the docs, but that doesn't explain why a normal 'call puts' works without the extra indirection.
Thanks. (BTW do I have to answer all those questions about Franco and Mussolini every time I make a post? And, apparently, edit one.)
Note, the test.obj file from Nasm was linked as follows:
golink /console /entry main /fo test.exe test.obj \windows\system32\msvcrt.dll