summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-15 15:22:03 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-15 15:22:03 -0700
commitb048324b9e6ba43b1add7c4dbbab61b1b1297a2d (patch)
tree97990ba9ba977d5e7a9a2fe09e4bfef32666377b /test
parenta3e57106fab38aac060a3292b8a34d655fc673d5 (diff)
downloadnasm-b048324b9e6ba43b1add7c4dbbab61b1b1297a2d.tar.gz
nasm-b048324b9e6ba43b1add7c4dbbab61b1b1297a2d.tar.bz2
nasm-b048324b9e6ba43b1add7c4dbbab61b1b1297a2d.zip
Test for various ELF64 GOT references
Try to test for various GOT references in ELF64. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test')
-rw-r--r--test/gotoff64.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/gotoff64.asm b/test/gotoff64.asm
new file mode 100644
index 0000000..05f5882
--- /dev/null
+++ b/test/gotoff64.asm
@@ -0,0 +1,25 @@
+;Testname=noerr; Arguments=-felf64 -ogotoff64.o; Files=stdout stderr gotoff64.o
+;Testname=err; Arguments=-DERROR -felf64 -ogotoff64.o; Files=stdout stderr gotoff64.o
+
+ bits 64
+ default rel
+
+ extern foo
+
+ mov r15,[foo wrt ..got]
+ lea r12,[foo wrt ..got]
+%ifdef ERROR
+ lea rax,[foo wrt ..gotoff]
+ mov rax,[foo wrt ..gotoff]
+%endif
+
+ default abs
+
+ mov r15,[foo wrt ..got]
+ lea r12,[foo wrt ..got]
+ mov rax,[qword foo wrt ..got]
+%ifdef ERROR
+ lea rax,[foo wrt ..gotoff]
+ mov rax,[foo wrt ..gotoff]
+%endif
+ mov rax,[qword foo wrt ..gotoff]