summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/plugin-30.d26
-rw-r--r--ld/testsuite/ld-plugin/plugin.exp7
2 files changed, 32 insertions, 1 deletions
diff --git a/ld/testsuite/ld-plugin/plugin-30.d b/ld/testsuite/ld-plugin/plugin-30.d
new file mode 100644
index 00000000000..eb9d4244786
--- /dev/null
+++ b/ld/testsuite/ld-plugin/plugin-30.d
@@ -0,0 +1,26 @@
+Hello from testplugin.
+.*: LDPT_MESSAGE func@0x.*
+.*: LDPT_API_VERSION value 0x1 \(1\)
+.*: LDPT_GNU_LD_VERSION value 0x.*
+.*: LDPT_LINKER_OUTPUT value 0x1 \(1\)
+.*: LDPT_OUTPUT_NAME 'tmpdir/main.x'
+.*: LDPT_REGISTER_CLAIM_FILE_HOOK func@0x.*
+.*: LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK func@0x.*
+.*: LDPT_REGISTER_CLEANUP_HOOK func@0x.*
+.*: LDPT_ADD_SYMBOLS func@0x.*
+.*: LDPT_GET_INPUT_FILE func@0x.*
+.*: LDPT_GET_VIEW func@0x.*
+.*: LDPT_RELEASE_INPUT_FILE func@0x.*
+.*: LDPT_GET_SYMBOLS func@0x.*
+.*: LDPT_GET_SYMBOLS_V2 func@0x.*
+.*: LDPT_ADD_INPUT_FILE func@0x.*
+.*: LDPT_ADD_INPUT_LIBRARY func@0x.*
+.*: LDPT_SET_EXTRA_LIBRARY_PATH func@0x.*
+.*: LDPT_OPTION 'registerclaimfile'
+.*: LDPT_OPTION 'read:8'
+.*: LDPT_NULL value 0x0 \(0\)
+#...
+hook called: claim_file tmpdir/main.o \[@0/.* not claimed
+hook called: claim_file tmpdir/func.o \[@0/.* not claimed
+hook called: claim_file tmpdir/text.o \[@0/.* not claimed
+hook called: claim_file tmpdir/libempty.a \[@.* not claimed
diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp
index 4c9116b0246..a6946c47c2e 100644
--- a/ld/testsuite/ld-plugin/plugin.exp
+++ b/ld/testsuite/ld-plugin/plugin.exp
@@ -236,6 +236,10 @@ set plugin_lib_tests [list \
-plugin-opt sym:${_}text::0:0:0 \
-plugin-opt add:tmpdir/text.o \
$testsrcfiles_notext -Ltmpdir -ltext $libs" "" "" "" {{ld plugin-19.d}} "main.x" ] \
+ [list "plugin with empty archive" \
+ "-plugin $plugin_path $regclm \
+ -plugin-opt read:8 \
+ $testobjfiles tmpdir/libempty.a $libs" "" "" "" {{ld plugin-30.d}} "main.x" ] \
]
set plugin_extra_elf_tests [list \
@@ -289,7 +293,8 @@ if { [is_elf_format] \
run_ld_link_tests $plugin_extra_elf_tests
}
-if ![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] {
+if {![ar_simple_create $ar "" "tmpdir/libtext.a" "tmpdir/text.o"] || \
+ ![ar_simple_create $ar "" "tmpdir/libempty.a" ""]} {
foreach testitem $plugin_lib_tests {
unresolved [lindex $testitem 0]
}