aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-03-22 12:25:08 +0000
committerNick Clifton <nickc@redhat.com>2016-03-22 12:25:08 +0000
commit4153b6dbb0f38a16fd5b583761aa811212fbb9a5 (patch)
treed658cb18fecbd0a8691b62fed5924d583108b3a9 /ld/testsuite
parenta97fbc7e3ca781b8d95ed8591c6ee65f2d8a798a (diff)
downloadgdb-4153b6dbb0f38a16fd5b583761aa811212fbb9a5.zip
gdb-4153b6dbb0f38a16fd5b583761aa811212fbb9a5.tar.gz
gdb-4153b6dbb0f38a16fd5b583761aa811212fbb9a5.tar.bz2
Improve COFF/PE linker garbage collection by preventing the removal of sections containing exported symbols.
PR ld/19803 * ldlang.c (lang_add_gc_name): New function. Adds the provided symbol name to the list of gc symbols. (lang_process): Call lang_add_gc_name with entry_symbol_default if entry_symbol.name is NULL. Use lang_add_gc_name to add the init and fini function names. * pe-dll.c (process_def_file_and_drectve): Add exported names to the gc symbol list. * testsuite/ld-pe/pr19803.s: Do not export _testval symbol. * testsuite/ld-pe/pr19803.d: Tweak expected output.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-pe/pr19803.d12
-rw-r--r--ld/testsuite/ld-pe/pr19803.s1
2 files changed, 4 insertions, 9 deletions
diff --git a/ld/testsuite/ld-pe/pr19803.d b/ld/testsuite/ld-pe/pr19803.d
index 1fc6daf..d8d0c55 100644
--- a/ld/testsuite/ld-pe/pr19803.d
+++ b/ld/testsuite/ld-pe/pr19803.d
@@ -1,17 +1,13 @@
#ld: -shared --out-implib dx.dll.a --gc-sections
#objdump: --syms
-#notarget: mcore-* arm-epoc-pe
+#notarget: mcore-*
#
-# Check that the target specific entry symbol _DllMainCRTStartup is still
+# The MCORE-PE target does not support -shared.
+#
+# Check that the target specific entry symbol *Startup 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.s b/ld/testsuite/ld-pe/pr19803.s
index 290a698..cabb87e 100644
--- a/ld/testsuite/ld-pe/pr19803.s
+++ b/ld/testsuite/ld-pe/pr19803.s
@@ -8,7 +8,6 @@ DllMainCRTStartup:
nop
.section .rdata,"dr"
- .globl _testval
_testval:
.long 1
.long 2