aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin/pr27311c.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-02-02 15:05:14 +1030
committerAlan Modra <amodra@gmail.com>2021-02-02 20:09:42 +1030
commit9918bff7cf2a566aaa2036d2242a61c140652dc7 (patch)
treeb2498f984c21d1aa2ef837e1dab0e281fd392a43 /ld/testsuite/ld-plugin/pr27311c.c
parent2bd3e4b8d2580839a457e221d4e1e09105248215 (diff)
downloadgdb-9918bff7cf2a566aaa2036d2242a61c140652dc7.zip
gdb-9918bff7cf2a566aaa2036d2242a61c140652dc7.tar.gz
gdb-9918bff7cf2a566aaa2036d2242a61c140652dc7.tar.bz2
PR27311, ld.bfd (symbol from plugin): undefined reference
A default versioned symbol definition in a shared library is overridden by an unversioned definition in a regular object file, and thus should not be reason to make an as-needed library needed. bfd/ PR 27311 * elflink.c (_bfd_elf_add_default_symbol): Add override parameter. Use when handling default versioned symbol. Rename existing override variable to nondef_override and use for non-default versioned symbol. (elf_link_add_object_symbols): Adjust call to suit. Don't pull in as-needed libraries when override is set. ld/ * testsuite/ld-plugin/pr27311.d, * testsuite/ld-plugin/pr27311.ver, * testsuite/ld-plugin/pr27311a.c, * testsuite/ld-plugin/pr27311b.c, * testsuite/ld-plugin/pr27311c.c: New testcase. * testsuite/ld-plugin/lto.exp: Run it. Correct PR14918 and PR12982 entries.
Diffstat (limited to 'ld/testsuite/ld-plugin/pr27311c.c')
-rw-r--r--ld/testsuite/ld-plugin/pr27311c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/pr27311c.c b/ld/testsuite/ld-plugin/pr27311c.c
new file mode 100644
index 0000000..6712499
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr27311c.c
@@ -0,0 +1,5 @@
+void inlib1(void) {}
+int main()
+{
+ return 0;
+}