c++: Make references to __cxa_pure_virtual weak.
authorJason Merrill <jason@redhat.com>
Mon, 11 May 2020 18:05:46 +0000 (14:05 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 11 May 2020 19:10:05 +0000 (15:10 -0400)
commitaa2c978400f3b3ca6e9f2d18598a379589e77ba0
tree01a5cdae070da6abcbd646a94b31be0ab26d8761
parente5ccab839a24a9c5ac1ddbb6e0ad1c339df3165e
c++: Make references to __cxa_pure_virtual weak.

If a program has no other dependencies on libstdc++, we shouldn't require it
just for __cxa_pure_virtual, which is only there to give a prettier
diagnostic before crashing the program; resolving the reference to NULL will
also crash, just without the diagnostic.

gcc/cp/ChangeLog
2020-05-11  Jason Merrill  <jason@redhat.com>

* decl.c (cxx_init_decl_processing): Call declare_weak for
__cxa_pure_virtual.
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/abi/pure-virtual1.C [new file with mode: 0644]