aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-07-04 08:55:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-07-04 08:55:20 -0700
commitc3e1c28ebfdb20ff4498bcc792228283b903d393 (patch)
treead03cee00b4e79c0ca3c9cbbf7a864253fc4ed2d /ld/testsuite/ld-plugin
parent1dc8bf195d2c4d382e0d6d371f16ebfe83573acc (diff)
downloadgdb-c3e1c28ebfdb20ff4498bcc792228283b903d393.zip
gdb-c3e1c28ebfdb20ff4498bcc792228283b903d393.tar.gz
gdb-c3e1c28ebfdb20ff4498bcc792228283b903d393.tar.bz2
Warn and return for duplicated plugin
If a plugin has been loaded already, we should warn and return, instead of adding it on the plugin list. PR ld/20321 * plugin.c (plugin_opt_plugin): Warn and return if plugin has been loaded already. * testsuite/ld-plugin/lto.exp: Run PR ld/20321 test. * testsuite/ld-plugin/pr20321.c: New file.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp3
-rw-r--r--ld/testsuite/ld-plugin/pr20321.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 80bc469..2ecb4d0 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -198,6 +198,9 @@ set lto_link_tests [list \
[list "Build libpr20267b.a" \
"$plug_opt" "-flto $lto_no_fat" \
{pr20267b.c} {} "libpr20267b.a"] \
+ [list "Build pr20321" \
+ "-Wl,-plugin,$plug_so" "-flto" \
+ {pr20321.c} {} "pr20321" "c" ".*: duplicated plugin"] \
]
if { [at_least_gcc_version 4 7] } {
diff --git a/ld/testsuite/ld-plugin/pr20321.c b/ld/testsuite/ld-plugin/pr20321.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr20321.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}