aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pe
diff options
context:
space:
mode:
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>2016-03-18 09:51:47 +0000
committerNick Clifton <nickc@redhat.com>2016-03-18 09:51:47 +0000
commit41f46ed9fea1a066de95b6a85c56393beef0b8b8 (patch)
tree74d49a75ad394fc318a67c240313c73421fe5837 /ld/testsuite/ld-pe
parente101a78be9388651099af079899b8654292d24f6 (diff)
downloadgdb-41f46ed9fea1a066de95b6a85c56393beef0b8b8.zip
gdb-41f46ed9fea1a066de95b6a85c56393beef0b8b8.tar.gz
gdb-41f46ed9fea1a066de95b6a85c56393beef0b8b8.tar.bz2
Fix possible failure in the AVR linker tests.
* ld-avr/gc-section-debugline.d: Relax regex check for CU.
Diffstat (limited to 'ld/testsuite/ld-pe')
-rw-r--r--ld/testsuite/ld-pe/pe.exp14
-rw-r--r--ld/testsuite/ld-pe/pr19803.d17
-rw-r--r--ld/testsuite/ld-pe/pr19803.e3
-rw-r--r--ld/testsuite/ld-pe/pr19803.s14
4 files changed, 48 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index 622caed..a31f6e7 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -76,6 +76,20 @@ run_dump_test "longsecn-5"
run_dump_test "orphan"
run_dump_test "orphan_nu"
+run_dump_test "pr19803"
+set pr19803_dll {
+ { "PR 19803: not exporting swept symbols"
+ "-shared --out-implib dx.dll --gc-sections"
+ "" "" {pr19803.s}
+ {{objdump "--syms dx.dll" pr19803.e}}
+ "a.exe"}
+}
+# This test is *supposed* to fail. If the symbol defined in pr19803.e is
+# found then it was not stripped from the export dll, despite the fact that
+# it (should have been) garbage collected from the executable.
+setup_xfail *-*-*
+run_ld_link_tests $pr19803_dll
+
if {[istarget x86_64-*-mingw*] } {
run_dump_test "cfi"
} elseif {[istarget i*86-*-cygwin*] || [istarget i*86-*-mingw*] } {
diff --git a/ld/testsuite/ld-pe/pr19803.d b/ld/testsuite/ld-pe/pr19803.d
new file mode 100644
index 0000000..1fc6daf
--- /dev/null
+++ b/ld/testsuite/ld-pe/pr19803.d
@@ -0,0 +1,17 @@
+#ld: -shared --out-implib dx.dll.a --gc-sections
+#objdump: --syms
+#notarget: mcore-* arm-epoc-pe
+#
+# Check that the target specific entry symbol _DllMainCRTStartup is still
+# a defined (sec > 0), public (scl == 2) symbol, even after garbage
+# collection.
+#
+# Check that the symbol _testval is undefined (sec == 0) and hidden
+# (scl == 106) in the output. It should have been changed to this state when
+# garbage collection was performed.
+
+#...
+.*\(sec 0\)\(fl 0x00\)\(ty 0\)\(scl 106\) \(nx 0\) 0x0+000 _testval
+#...
+.*\(sec 1\)\(fl 0x00\)\(ty 0\)\(scl 2\) \(nx 0\) 0x0+000 .*Startup.*
+#pass
diff --git a/ld/testsuite/ld-pe/pr19803.e b/ld/testsuite/ld-pe/pr19803.e
new file mode 100644
index 0000000..a2f8162
--- /dev/null
+++ b/ld/testsuite/ld-pe/pr19803.e
@@ -0,0 +1,3 @@
+#...
+.*__imp__testval
+#pass
diff --git a/ld/testsuite/ld-pe/pr19803.s b/ld/testsuite/ld-pe/pr19803.s
new file mode 100644
index 0000000..290a698
--- /dev/null
+++ b/ld/testsuite/ld-pe/pr19803.s
@@ -0,0 +1,14 @@
+ .text
+ .globl "_DllMainCRTStartup@12"
+"_DllMainCRTStartup@12":
+ .globl _DllMainCRTStartup
+_DllMainCRTStartup:
+ .globl DllMainCRTStartup
+DllMainCRTStartup:
+ nop
+
+ .section .rdata,"dr"
+ .globl _testval
+_testval:
+ .long 1
+ .long 2