aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-11-13 11:07:31 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-11-13 11:09:40 -0800
commit553d1284b7820ebc88a2e9500d813441c642bdc9 (patch)
tree18b80b0c803e11ae159d05b588c2bef38cde6b34 /gas
parent5784b3caf8e2d55339994067e7f05dd047109b87 (diff)
downloadgdb-553d1284b7820ebc88a2e9500d813441c642bdc9.zip
gdb-553d1284b7820ebc88a2e9500d813441c642bdc9.tar.gz
gdb-553d1284b7820ebc88a2e9500d813441c642bdc9.tar.bz2
Add assembler support for @gotplt
Obsolete R_X86_64_GOTPLT64 and treat it the same as R_X86_64_GOT64. bfd/ PR gas/17598 * elf64-x86-64.c (elf_x86_64_check_relocs): Treat R_X86_64_GOTPLT64 the same as R_X86_64_GOT64. (elf_x86_64_relocate_section): Likewise. gas/ PR gas/17598 * config/tc-i386.c (reloc): Support BFD_RELOC_X86_64_GOTPLT64. gas/testsuite/ PR gas/17598 * gas/i386/reloc64.s: Add @gotplt check. * gas/i386/reloc64.d: Updated. * gas/i386/reloc64.l: Likewise. ld/testsuite/ PR gas/17598 * ld-x86-64/x86-64.exp: Run gotplt1. * ld-x86-64/gotplt1.d: New file. * ld-x86-64/gotplt1.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c3
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/i386/reloc64.d2
-rw-r--r--gas/testsuite/gas/i386/reloc64.l10
-rw-r--r--gas/testsuite/gas/i386/reloc64.s16
6 files changed, 44 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index e7248c4..e674476 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/17598
+ * config/tc-i386.c (reloc): Support BFD_RELOC_X86_64_GOTPLT64.
+
2014-11-13 Nick Clifton <nickc@redhat.com>
PR binutils/17512
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 51d58c1..f54f077 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2835,6 +2835,9 @@ reloc (unsigned int size,
case BFD_RELOC_X86_64_GOT32:
return BFD_RELOC_X86_64_GOT64;
break;
+ case BFD_RELOC_X86_64_GOTPLT64:
+ return BFD_RELOC_X86_64_GOTPLT64;
+ break;
case BFD_RELOC_X86_64_PLTOFF64:
return BFD_RELOC_X86_64_PLTOFF64;
break;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 972b2e6..7908363 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/17598
+ * gas/i386/reloc64.s: Add @gotplt check.
+
+ * gas/i386/reloc64.d: Updated.
+ * gas/i386/reloc64.l: Likewise.
+
2014-11-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/17482
diff --git a/gas/testsuite/gas/i386/reloc64.d b/gas/testsuite/gas/i386/reloc64.d
index 4491982..ea7f696 100644
--- a/gas/testsuite/gas/i386/reloc64.d
+++ b/gas/testsuite/gas/i386/reloc64.d
@@ -50,6 +50,7 @@ Disassembly of section \.text:
.*[ ]+R_X86_64_TPOFF32[ ]+xtrn
.*[ ]+R_X86_64_TPOFF32[ ]+xtrn
.*[ ]+R_X86_64_TPOFF32[ ]+xtrn
+.*[ ]+R_X86_64_GOTPLT64[ ]+xtrn
Disassembly of section \.data:
#...
.*[ ]+R_X86_64_64[ ]+xtrn
@@ -89,3 +90,4 @@ Disassembly of section \.data:
.*[ ]+R_X86_64_PC8[ ]+xtrn
.*[ ]+R_X86_64_GOT32[ ]+xtrn-0x4
.*[ ]+R_X86_64_GOT32[ ]+xtrn\+0x4
+.*[ ]+R_X86_64_GOTPLT64[ ]+xtrn
diff --git a/gas/testsuite/gas/i386/reloc64.l b/gas/testsuite/gas/i386/reloc64.l
index ded5cab..5e970cb 100644
--- a/gas/testsuite/gas/i386/reloc64.l
+++ b/gas/testsuite/gas/i386/reloc64.l
@@ -71,3 +71,13 @@
.*:195: Error: .*
.*:196: Error: .*
.*:197: Error: .*
+.*:208: Error: .*
+.*:209: Error: .*
+.*:210: Error: .*
+.*:211: Error: .*
+.*:212: Error: .*
+.*:213: Error: .*
+.*:214: Error: .*
+.*:218: Error: .*
+.*:219: Error: .*
+.*:220: Error: .*
diff --git a/gas/testsuite/gas/i386/reloc64.s b/gas/testsuite/gas/i386/reloc64.s
index 7b35a02..ecaaef5 100644
--- a/gas/testsuite/gas/i386/reloc64.s
+++ b/gas/testsuite/gas/i386/reloc64.s
@@ -202,3 +202,19 @@ bad .byte xtrn@tpoff
.data
.long xtrn@got - 4
.long xtrn@got + 4
+
+ .text
+ movabs $xtrn@gotplt, %rax
+bad add $xtrn@gotplt, %rax
+bad mov $xtrn@gotplt, %eax
+bad mov $xtrn@gotplt, %ax
+bad mov $xtrn@gotplt, %al
+bad mov xtrn@gotplt(%rbx), %eax
+bad mov xtrn@gotplt(%ebx), %eax
+bad call xtrn@gotplt
+
+ .data
+ .quad xtrn@gotplt
+bad .long xtrn@gotplt
+bad .word xtrn@gotplt
+bad .byte xtrn@gotplt