aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-08-27 07:59:48 -0700
committerH.J. Lu <hjl.tools@gmail.com>2014-08-27 07:59:48 -0700
commitc8831961f9fecf81e90fe7c8c94b47e01ee64662 (patch)
tree22fb029acee0d6388275d2628613dd74bfaa2063 /ld/testsuite/ld-i386
parent29a9f53e857c5d55df852d0a5d5c41a9247c16a2 (diff)
downloadgdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.zip
gdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.tar.gz
gdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.tar.bz2
Use bfd_is_abs_section to check discarded input section
bfd/ PR ld/17306 * elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section to check discarded input section. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. ld/testsuite/ PR ld/17306 * ld-i386/i386.exp (i386tests): Add tests for PR ld/17306. * ld-x86-64/x86-64.exp (x86_64tests): Likewise. * ld-i386/pr17306a.s: New file. * ld-i386/pr17306b.s: Likewise. * ld-x86-64/pr17306a.s: Likewise. * ld-x86-64/pr17306b.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp4
-rw-r--r--ld/testsuite/ld-i386/pr17306a.s9
-rw-r--r--ld/testsuite/ld-i386/pr17306b.s2
3 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 875c816..30be98a 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -187,6 +187,10 @@ set i386tests {
"--32" {zero.s} {} ""}
{"PR ld/17313 (2)" "-melf_i386 -shared --just-symbols=tmpdir/zero.o" ""
"--32" {lea1.s} {} "libpr17313.so"}
+ {"PR ld/17306 (1)" "-melf_i386" ""
+ "--32" {pr17306b.s} {} ""}
+ {"PR ld/17306 (2)" "-melf_i386 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
+ "--32" {pr17306a.s} {} "libpr17306.so"}
}
# So as to avoid rewriting every last test case here in a nacl variant,
diff --git a/ld/testsuite/ld-i386/pr17306a.s b/ld/testsuite/ld-i386/pr17306a.s
new file mode 100644
index 0000000..fe2d49c
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr17306a.s
@@ -0,0 +1,9 @@
+ .data
+ .globl foo
+foo:
+ .long -1
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ pushl foo@GOT(%ebx)
diff --git a/ld/testsuite/ld-i386/pr17306b.s b/ld/testsuite/ld-i386/pr17306b.s
new file mode 100644
index 0000000..2f84e52
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr17306b.s
@@ -0,0 +1,2 @@
+ .text
+ movl foo@GOT(%ebx), %eax