summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-06 19:11:07 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-06 19:11:07 -0700
commit9f8171317d27fbee3326ed2ffc917de2c7f1dd42 (patch)
treee8ab6713d107c00cc87ba34f44fdf0ea2afe5b7c /test
parenta9ed99bddfd1d36ce98417f926d55a26e64d441d (diff)
downloadnasm-9f8171317d27fbee3326ed2ffc917de2c7f1dd42.tar.gz
BR 2148448: Fix RIP-relative addressing with an immediate
When there is an immediate in the instruction, a RIP-relative offset may not be relative to the end of the offset itself, since it is relative to the end of the *instruction*, not the end of the *offset*. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test')
-rw-r--r--test/riprel2.asm11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/riprel2.asm b/test/riprel2.asm
new file mode 100644
index 00000000..2d13d3e4
--- /dev/null
+++ b/test/riprel2.asm
@@ -0,0 +1,11 @@
+;Testname=unoptimized; Arguments=-fbin -oriprel2.bin -O0; Files=stdout stderr riprel.bin
+;Testname=optimized; Arguments=-fbin -oriprel2.bin -Ox; Files=stdout stderr riprel.bin
+
+ bits 64
+
+ default rel
+ mov dword [foo],12345678h
+ mov qword [foo],12345678h
+ mov [foo],rax
+ mov dword [foo],12345678h
+foo: