aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin/lto.exp
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2019-04-26 07:52:00 -0700
committerH.J. Lu <hjl.tools@gmail.com>2019-04-26 07:52:09 -0700
commitc54f15248ee990df6cea0b4730cd61b227a0e082 (patch)
treec1549a19c4b4e75fb7ab4d6d8a03d6e75c5f0c67 /ld/testsuite/ld-plugin/lto.exp
parent8e1920d611ab3330d6dfa610ff771cf5dc796097 (diff)
downloadgdb-c54f15248ee990df6cea0b4730cd61b227a0e082.zip
gdb-c54f15248ee990df6cea0b4730cd61b227a0e082.tar.gz
gdb-c54f15248ee990df6cea0b4730cd61b227a0e082.tar.bz2
Don't complain undefined weak dynamic reference
When undefined non-weak references in IR objects are optimized out by LTO, we can have weak dynamic referencs to symbols marked with bfd_link_hash_undefined. We shouldn't complain such undefined weak dynamic references. bfd/ PR ld/24486 * elflink.c (elf_link_output_extsym): Don't complain undefined weak dynamic reference. ld/ PR ld/24486 * testsuite/ld-plugin/lto.exp: Run PR ld/24486 tests. * testsuite/ld-plugin/pr24486a.c: New file. * testsuite/ld-plugin/pr24486b.c: Likewise. * testsuite/ld-plugin/pr24486c.c: Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin/lto.exp')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index b13a773..e913c6f 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -325,6 +325,18 @@ set lto_link_elf_tests [list \
[list {Build pr22220main.o} \
{} {-flto} \
{pr22220main.cc} {} {} {c++}] \
+ [list "Build pr24486a.o" \
+ "$plug_opt" "-flto -O2" \
+ {pr24486a.c} {} "" "c"] \
+ [list "Build pr24486b.so" \
+ "-shared" "-O2 -fpic" \
+ {pr24486b.c} {} "pr24486b.so" "c"] \
+ [list "Build pr24486c.so" \
+ "-shared -Wl,--no-as-needed tmpdir/pr24486b.so" "-O2 -fpic" \
+ {pr24486c.c} {} "pr24486c.so" "c"] \
+ [list "PR ld/24486" \
+ "-O2 -flto tmpdir/pr24486a.o tmpdir/pr24486c.so -Wl,--as-needed tmpdir/pr24486b.so" "" \
+ {dummy.c} {} "pr24486.exe"] \
]
# PR 14918 checks that libgcc is not spuriously included in a shared link of