public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5549] libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF.
@ 2021-11-26 19:41 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2021-11-26 19:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:caa04517e6f78a562f36897a6e7171f0121101b4

commit r12-5549-gcaa04517e6f78a562f36897a6e7171f0121101b4
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Nov 21 10:49:29 2021 +0000

    libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF.
    
    Recent improvements to null address warnings notice that for
    targets that do not support HAVE_ELF_STYLE_WEAKREF the dummy stub
    implementation of __cxa_get_globals() means that the address can
    never be null.
    
    Fixed by removing the test for such targets.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    
    libitm/ChangeLog:
    
            * eh_cpp.cc (GTM::gtm_thread::init_cpp_exceptions): If the
            target does not support HAVE_ELF_STYLE_WEAKREF then do not
            try to test the __cxa_get_globals against NULL.

Diff:
---
 libitm/eh_cpp.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc
index 4909427b405..57beb1a147f 100644
--- a/libitm/eh_cpp.cc
+++ b/libitm/eh_cpp.cc
@@ -178,7 +178,11 @@ GTM::gtm_thread::init_cpp_exceptions ()
 {
   // Only save and restore the number of uncaught exceptions if this is
   // actually used in the program.
-  if (__cxa_get_globals != NULL && __cxa_get_globals () != 0)
+  if (
+#if HAVE_ELF_STYLE_WEAKREF
+      __cxa_get_globals != NULL &&
+#endif
+      __cxa_get_globals () != 0)
     cxa_uncaught_count_ptr = &__cxa_get_globals ()->uncaughtExceptions;
   else
     cxa_uncaught_count_ptr = 0;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-26 19:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26 19:41 [gcc r12-5549] libitm: Fix bootstrap for targets without HAVE_ELF_STYLE_WEAKREF Iain D Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).