The test is on 64-bit/x86 Ubuntu 12.04. With GCC
4.6.3.
So basically I am manipulating some x64 assembly code. And I observed that RIP-relative addressing require the absolute address to be 16-byte aligned.
Here is an example when debugging using gdb
:
0x40f38d <S_0x40F614+61> xorpd 0x84d3(%rip),%xmm0 # 0x417868 <S_0x417DE0>
This memory reference to address 0x417868
fail (segmentation fault), as this address is only 8-byte aligned.
0x40f38d <S_0x40F614+61> xorpd 0x8a4b(%rip),%xmm0 # 0x417de0 <S_0x417DE0>
This memory reference can work, as address 0x417de0
is 16 byte aligned.
This is my observation, and I didn't find any official materials discussing about this issue. Could anyone tell me
- Is this 16-byte alignment requirement universally true?
- If so, then does any official document/manual talking about this?
xorpd
instruction that requires 16-byte alignment for the memory operand. – Mysticial