nasm/test/relocs.asm
H. Peter Anvin 72bf3fe98c assemble: Only treat a displacement as signed if it is < asize
Only generate a signed relocation if the displacement size is less
than the address size.  This matters when involving address size
overrides.

It is technically impossible to do this one perfectly, because it is
never really knowable if the displacement offset is used as a base or
an index.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-26 20:19:53 -08:00

20 lines
257 B
NASM

bits 64
extern foo
mov eax,[foo]
mov rax,[foo]
mov rax,[qword foo]
mov eax,[a32 foo]
mov rax,[a32 foo]
mov rax,[a32 qword foo]
mov eax,foo
mov rax,dword foo
mov rax,qword foo
mov eax,foo
mov rax,dword foo
mov rax,qword foo
dd foo
dq foo