Position Independent Code pointing to wrong address
问题 I have a small example program written in NASM(2.11.08) targeting the macho64 architecture. I'm running OSX 10.10.3: bits 64 section .data msg1 db 'Message One', 10, 0 msg1len equ $-msg1 msg2 db 'Message Two', 10, 0 msg2len equ $-msg2 section .text global _main extern _printf _main: sub rsp, 8 ; align lea rdi, [rel msg1] xor rax, rax call _printf lea rdi, [rel msg2] xor rax, rax call _printf add rsp, 8 ret I'm compiling and linking using the following command line: /usr/local/bin/nasm -f