How do I use RIP Relative Addressing in a Linux assembly program for the AMD64 archtitecture? I am looking for a simple example (a Hello world program) that uses the AMD64 R
I believe that you want to load the address of your string into %rsi
; your code attempts to load a quadword from that address rather than the address itself. You want:
lea msg(%rip), %rsi
if I'm not mistaken. I don't have a linux box to test on, however.
Since you need the address of msg in %rsi, just replace:
mov msg(%rip),%rsi
with:
lea msg(%rip),%rsi