summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/i386/x86-64-gprel.s
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-03 09:43:28 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-04 10:21:07 -0700
commitdc044a14027136c864d69c83598f3ba37c44fc9c (patch)
treef09cf65dd04daaf5a59c8056e09b48cb61698e1e /gas/testsuite/gas/i386/x86-64-gprel.s
parentf02fd7745d003d65fd3b981618e07b874b721d79 (diff)
downloadbinutils-gdb-users/hjl/gprel/master.tar.gz
Add R_X86_64_GPRELusers/hjl/gprel/master
"%seg:foo@GPREL" is used to address symbol, foo, relative to __gp. foo is addressed by %seg + offset of foo relative to __gp. Linker sets __gp to the middle of GP section which contains definitions of symbols with GPREL relocations. Run-time should load address of __gp into segment register, %seg before accessing foo via "%seg:foo@GPREL".
Diffstat (limited to 'gas/testsuite/gas/i386/x86-64-gprel.s')
-rw-r--r--gas/testsuite/gas/i386/x86-64-gprel.s3
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/x86-64-gprel.s b/gas/testsuite/gas/i386/x86-64-gprel.s
new file mode 100644
index 00000000000..96b3ce90444
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-gprel.s
@@ -0,0 +1,3 @@
+ .text
+_start:
+ movl %gs:foo@GPREL, %eax