get address of label: (Mac x64)
Posted: Tue Dec 20, 2016 10:59 am
How to get the address of a label in Mac x64?
The following works fine in Win64 and Linux64:
But it won't compile in Mac64:
(I tried - amongst a thousand other things - l_mylabel but no go, as well as [mylabel] encapsulated in square brackets but obviously that just ended up displaying 01020304 - the data at the address, not the address itself)
The following works fine in Win64 and Linux64:
Code: Select all
DisableDebugger
Define address.i
! mov rax, mylabel ;<-- fine in Win/Linux, not Mac?
! mov qword [v_address], rax
MessageRequester("Label address", Hex(address))
DataSection
!mylabel:
!db 1,2,3,4,5,6,7,8
EndDataSection
I tried with EnableAsm and PB inline (as opposed to !-forced inline) but same problempurebasic.asm:115: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" And "dq _foo" for pointers.
(I tried - amongst a thousand other things - l_mylabel but no go, as well as [mylabel] encapsulated in square brackets but obviously that just ended up displaying 01020304 - the data at the address, not the address itself)