[pushed] c++: Make references to __cxa_pure_virtual weak.

Andreas Schwab schwab@linux-m68k.org
Tue May 12 08:27:45 GMT 2020


On Mai 11 2020, Jason Merrill via Gcc-patches wrote:

> 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.

That doesn't work on ia64:

pure-virtual1.o:(.data.rel.ro._ZTV1A[_ZTV1A]+0x10): undefined reference to `__cxa_pure_virtual'
collect2: error: ld returned 1 exit status
$ nm -u pure-virtual1.o 
                 U __cxa_pure_virtual

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Gcc-patches mailing list