summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-01-14 22:48:12 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-01-14 22:48:12 +0000
commit248775ba37b0ef8b8ef46b34b231a569722e628c (patch)
treef6caebc5cf0a0b1bf6269be5565a2a0e71937981 /ld
parent2c291032cceb2390927dbe4c2a3c793f02c526aa (diff)
downloadbinutils-gdb-248775ba37b0ef8b8ef46b34b231a569722e628c.tar.gz
Handle R_X86_64_32 like R_X86_64_64 for ILP32.
bfd/ 2011-01-14 H.J. Lu <hongjiu.lu@intel.com> * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type. (elf_x86_64_link_hash_table_create): Set pointer_r_type. (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64 for ILP32. Remove ABI_64_P PIC check for R_X86_64_8, R_X86_64_16, R_X86_64_32 and R_X86_64_32S. (elf_x86_64_relocate_section): Handle R_X86_64_32 like R_X86_64_64 for ILP32. ld/testsuite/ 2011-01-14 H.J. Lu <hongjiu.lu@intel.com> * ld-x86-64/ilp32-5.d: New. * ld-x86-64/ilp32-5.s: Likewise. * ld-x86-64/x86-64.exp: Run ilp32-5.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-x86-64/ilp32-5.d8
-rw-r--r--ld/testsuite/ld-x86-64/ilp32-5.s8
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp1
4 files changed, 24 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 02c0c343276..897e3db8f04 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-x86-64/ilp32-5.d: New.
+ * ld-x86-64/ilp32-5.s: Likewise.
+
+ * ld-x86-64/x86-64.exp: Run ilp32-5.
+
2011-01-13 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/ilp32-4.d: New.
diff --git a/ld/testsuite/ld-x86-64/ilp32-5.d b/ld/testsuite/ld-x86-64/ilp32-5.d
new file mode 100644
index 00000000000..8f5025ebe90
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/ilp32-5.d
@@ -0,0 +1,8 @@
+#as: --n32
+#ld: -m elf32_x86_64 -shared
+#readelf: -r --wide
+
+#...
+[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+
+[0-9a-f]+ +[0-9a-f]+ +R_X86_64_PC32 +[0-9a-f]+ +foo - 4
+[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +[0-9a-f]+ +foo \+ 0
diff --git a/ld/testsuite/ld-x86-64/ilp32-5.s b/ld/testsuite/ld-x86-64/ilp32-5.s
new file mode 100644
index 00000000000..0d97807395e
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/ilp32-5.s
@@ -0,0 +1,8 @@
+ .globl bar
+bar:
+ mov foo(%rip), %rax
+
+ .data
+xxx:
+ .long foo
+ .long xxx
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 3aec797619a..e69ade6c42e 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -176,6 +176,7 @@ run_dump_test "ilp32-1"
run_dump_test "ilp32-2"
run_dump_test "ilp32-3"
run_dump_test "ilp32-4"
+run_dump_test "ilp32-5"
run_dump_test "ia32-1"
run_dump_test "ia32-2"
run_dump_test "ia32-3"