aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-14 11:41:58 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-14 12:29:29 -0700
commit5e5e02aeca4a6edccbf11b5f900d95bba59b9932 (patch)
tree75d5fa026dbb595fa819238129eb9cdb9e46b868 /ld/testsuite/ld-i386
parent26e53f3eace35cabeec4559d417df99a48f6477a (diff)
downloadgdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.zip
gdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.tar.gz
gdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.tar.bz2
x86: Cache section contents and relocations
bfd/ PR ld/22135 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument to indicate if conversion is performed. (elf_i386_check_relocs): Cache section contents and relocations if conversion is performed. * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section contents and relocations if conversion is performed. ld/ PR ld/22135 * testsuite/ld-i386/i386.exp: Run pr22135. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr22135.d: New file. * testsuite/ld-i386/pr22135.s: Likewise. * testsuite/ld-x86-64/pr22135.d: Likewise. * testsuite/ld-x86-64/pr22135.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr22135.d12
-rw-r--r--ld/testsuite/ld-i386/pr22135.s11
3 files changed, 24 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index f691c32..d79c4583 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -444,6 +444,7 @@ run_dump_test "pr22115-1a"
run_dump_test "pr22115-1b"
run_dump_test "pr22115-1c"
run_dump_test "pr22115-1d"
+run_dump_test "pr22135"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr22135.d b/ld/testsuite/ld-i386/pr22135.d
new file mode 100644
index 0000000..a5796ba
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr22135.d
@@ -0,0 +1,12 @@
+#as: --32 -mrelax-relocations=yes
+#ld: -pie -melf_i386 --no-keep-memory
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[ ]*[a-f0-9]+: 8d 81 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%ecx\),%eax
+#pass
diff --git a/ld/testsuite/ld-i386/pr22135.s b/ld/testsuite/ld-i386/pr22135.s
new file mode 100644
index 0000000..6afad88
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr22135.s
@@ -0,0 +1,11 @@
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl _start
+ .type _start, @function
+_start:
+ movl foo@GOT(%ecx), %eax
+ .size _start, .-_start