Use PTR_MANGLE and PTR_DEMANGLE unconditionally in C sources
authorFlorian Weimer <fweimer@redhat.com>
Tue, 18 Oct 2022 15:00:07 +0000 (17:00 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 18 Oct 2022 15:04:10 +0000 (17:04 +0200)
In the future, this will result in a compilation failure if the
macros are unexpectedly undefined (due to header inclusion ordering
or header inclusion missing altogether).

Assembler sources are more difficult to convert.  In many cases,
they are hand-optimized for the mangling and no-mangling variants,
which is why they are not converted.

sysdeps/s390/s390-32/__longjmp.c and sysdeps/s390/s390-64/__longjmp.c
are special: These are C sources, but most of the implementation is
in assembler, so the PTR_DEMANGLE macro has to be undefined in some
cases, to match the assembler style.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
50 files changed:
hurd/sigunwind.c
iconv/gconv.c
iconv/gconv_cache.c
iconv/gconv_db.c
iconv/gconv_dl.c
iconv/gconv_trans.c
iconv/skeleton.c
inet/idna.c
libio/iofopncook.c
libio/iofwide.c
libio/libioP.h
libio/vtables.c
misc/unwind-link.c
nss/nss_module.c
stdlib/cxa_atexit.c
stdlib/cxa_finalize.c
stdlib/cxa_thread_atexit_impl.c
stdlib/exit.c
stdlib/on_exit.c
sysdeps/aarch64/jmpbuf-offsets.h
sysdeps/alpha/jmpbuf-unwind.h
sysdeps/arc/jmpbuf-unwind.h
sysdeps/arm/jmpbuf-unwind.h
sysdeps/csky/jmpbuf-unwind.h
sysdeps/generic/unwind-link.h
sysdeps/i386/jmpbuf-unwind.h
sysdeps/i386/unwind-arch.h
sysdeps/loongarch/jmpbuf-unwind.h
sysdeps/m68k/jmpbuf-unwind.h
sysdeps/mach/hurd/jmp-unwind.c
sysdeps/microblaze/jmpbuf-unwind.h
sysdeps/mips/jmpbuf-unwind.h
sysdeps/nios2/jmpbuf-offsets.h
sysdeps/powerpc/jmpbuf-unwind.h
sysdeps/riscv/jmpbuf-unwind.h
sysdeps/s390/jmpbuf-unwind.h
sysdeps/s390/s390-32/__longjmp.c
sysdeps/s390/s390-64/__longjmp.c
sysdeps/sh/jmpbuf-unwind.h
sysdeps/sparc/sparc32/jmpbuf-unwind.h
sysdeps/x86_64/jmpbuf-unwind.h
wcsmbs/btowc.c
wcsmbs/mbrtoc16.c
wcsmbs/mbrtowc.c
wcsmbs/mbsnrtowcs.c
wcsmbs/mbsrtowcs_l.c
wcsmbs/wcrtomb.c
wcsmbs/wcsnrtombs.c
wcsmbs/wcsrtombs.c
wcsmbs/wctob.c

index 2821309..f114990 100644 (file)
@@ -73,9 +73,7 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val)
 
       inline uintptr_t demangle_ptr (uintptr_t x)
        {
-# ifdef PTR_DEMANGLE
          PTR_DEMANGLE (x);
-# endif
          return x;
        }
 
index dea9c80..592a759 100644 (file)
@@ -46,10 +46,8 @@ __gconv (__gconv_t cd, const unsigned char **inbuf,
   cd->__data[last_step].__outbufend = outbufend;
 
   __gconv_fct fct = cd->__steps->__fct;
-#ifdef PTR_DEMANGLE
   if (cd->__steps->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   if (inbuf == NULL || *inbuf == NULL)
     {
index 5dbf596..8d47545 100644 (file)
@@ -205,16 +205,11 @@ find_module (const char *directory, const char *filename,
 
       /* Call the init function.  */
       __gconv_init_fct init_fct = result->__init_fct;
-#ifdef PTR_DEMANGLE
       PTR_DEMANGLE (init_fct);
-#endif
       if (init_fct != NULL)
        {
          status = DL_CALL_FCT (init_fct, (result));
-
-#ifdef PTR_MANGLE
          PTR_MANGLE (result->__btowc_fct);
-#endif
        }
     }
 
index 90037fd..4943c95 100644 (file)
@@ -180,9 +180,7 @@ free_derivation (void *p)
        && deriv->steps[cnt].__shlib_handle != NULL)
       {
        __gconv_end_fct end_fct = deriv->steps[cnt].__end_fct;
-#ifdef PTR_DEMANGLE
        PTR_DEMANGLE (end_fct);
-#endif
        if (end_fct != NULL)
          DL_CALL_FCT (end_fct, (&deriv->steps[cnt]));
       }
@@ -208,9 +206,7 @@ __gconv_release_step (struct __gconv_step *step)
     {
       /* Call the destructor.  */
        __gconv_end_fct end_fct = step->__end_fct;
-#ifdef PTR_DEMANGLE
        PTR_DEMANGLE (end_fct);
-#endif
       if (end_fct != NULL)
        DL_CALL_FCT (end_fct, (step));
 
@@ -303,9 +299,7 @@ gen_steps (struct derivation_step *best, const char *toset,
 
              /* Call the init function.  */
              __gconv_init_fct init_fct = result[step_cnt].__init_fct;
-# ifdef PTR_DEMANGLE
              PTR_DEMANGLE (init_fct);
-# endif
              if (init_fct != NULL)
                {
                  status = DL_CALL_FCT (init_fct, (&result[step_cnt]));
@@ -316,17 +310,13 @@ gen_steps (struct derivation_step *best, const char *toset,
                      /* Do not call the end function because the init
                         function has failed.  */
                      result[step_cnt].__end_fct = NULL;
-# ifdef PTR_MANGLE
                      PTR_MANGLE (result[step_cnt].__end_fct);
-# endif
                      /* Make sure we unload this module.  */
                      --step_cnt;
                      break;
                    }
                }
-# ifdef PTR_MANGLE
              PTR_MANGLE (result[step_cnt].__btowc_fct);
-# endif
            }
          else
 #endif
@@ -404,15 +394,10 @@ increment_counter (struct __gconv_step *steps, size_t nsteps)
 
              /* Call the init function.  */
              __gconv_init_fct init_fct = step->__init_fct;
-#ifdef PTR_DEMANGLE
              PTR_DEMANGLE (init_fct);
-#endif
              if (init_fct != NULL)
                DL_CALL_FCT (init_fct, (step));
-
-#ifdef PTR_MANGLE
              PTR_MANGLE (step->__btowc_fct);
-#endif
            }
        }
     }
index c93c5dd..5ed9826 100644 (file)
@@ -127,11 +127,9 @@ __gconv_find_shlib (const char *name)
                  found->init_fct = __libc_dlsym (found->handle, "gconv_init");
                  found->end_fct = __libc_dlsym (found->handle, "gconv_end");
 
-#ifdef PTR_MANGLE
                  PTR_MANGLE (found->fct);
                  PTR_MANGLE (found->init_fct);
                  PTR_MANGLE (found->end_fct);
-#endif
 
                  /* We have succeeded in loading the shared object.  */
                  found->counter = 1;
index 0f4ce10..2255531 100644 (file)
@@ -53,10 +53,8 @@ __gconv_transliterate (struct __gconv_step *step,
   winbufend = (const uint32_t *) inbufend;
 
   __gconv_fct fct = step->__fct;
-#ifdef PTR_DEMANGLE
   if (step->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* If there is no transliteration information in the locale don't do
      anything and return the error.  */
index 42ee0b6..9eaf9a4 100644 (file)
@@ -404,10 +404,8 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
   if ((data->__flags & __GCONV_IS_LAST) == 0)
     {
       fct = next_step->__fct;
-#ifdef PTR_DEMANGLE
       if (next_step->__shlib_handle != NULL)
        PTR_DEMANGLE (fct);
-#endif
     }
 
   /* If the function is called with no input this means we have to reset
index df5811f..2243d3e 100644 (file)
@@ -73,10 +73,8 @@ functions_allocate (void *closure)
   result->handle = handle;
   result->lookup_ul = ptr_lookup_ul;
   result->to_unicode_lzlz = ptr_to_unicode_lzlz;
-#ifdef PTR_MANGLE
   PTR_MANGLE (result->lookup_ul);
   PTR_MANGLE (result->to_unicode_lzlz);
-#endif
 
   return result;
 }
@@ -138,9 +136,7 @@ __idna_to_dns_encoding (const char *name, char **result)
     return EAI_IDN_ENCODE;
   char *ptr = NULL;
   __typeof__ (functions->lookup_ul) fptr = functions->lookup_ul;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (fptr);
-#endif
   int ret = fptr (name, &ptr, 0);
   if (ret == 0)
     {
@@ -165,9 +161,7 @@ __idna_from_dns_encoding (const char *name, char **result)
     return gai_strdup (name, result);
   char *ptr = NULL;
   __typeof__ (functions->to_unicode_lzlz) fptr = functions->to_unicode_lzlz;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (fptr);
-#endif
   int ret = fptr (name, &ptr, 0);
   if (ret == 0)
     {
index a7db4ef..6c27610 100644 (file)
@@ -35,9 +35,7 @@ _IO_cookie_read (FILE *fp, void *buf, ssize_t size)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_read_function_t *read_cb = cfile->__io_functions.read;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (read_cb);
-#endif
 
   if (read_cb == NULL)
     return -1;
@@ -50,9 +48,7 @@ _IO_cookie_write (FILE *fp, const void *buf, ssize_t size)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_write_function_t *write_cb = cfile->__io_functions.write;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (write_cb);
-#endif
 
   if (write_cb == NULL)
     {
@@ -72,9 +68,7 @@ _IO_cookie_seek (FILE *fp, off64_t offset, int dir)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_seek_function_t *seek_cb = cfile->__io_functions.seek;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (seek_cb);
-#endif
 
   return ((seek_cb == NULL
           || (seek_cb (cfile->__cookie, &offset, dir)
@@ -88,9 +82,7 @@ _IO_cookie_close (FILE *fp)
 {
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   cookie_close_function_t *close_cb = cfile->__io_functions.close;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (close_cb);
-#endif
 
   if (close_cb == NULL)
     return 0;
@@ -139,12 +131,10 @@ static void
 set_callbacks (cookie_io_functions_t *target,
               cookie_io_functions_t source)
 {
-#ifdef PTR_MANGLE
   PTR_MANGLE (source.read);
   PTR_MANGLE (source.write);
   PTR_MANGLE (source.seek);
   PTR_MANGLE (source.close);
-#endif
   *target = source;
 }
 
@@ -226,9 +216,7 @@ _IO_old_cookie_seek (FILE *fp, off64_t offset, int dir)
   struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp;
   int (*seek_cb) (FILE *, off_t, int)
     = (int (*) (FILE *, off_t, int)) cfile->__io_functions.seek;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (seek_cb);
-#endif
 
   if (seek_cb == NULL)
     return _IO_pos_BAD;
index 1ce685f..37c353e 100644 (file)
@@ -124,10 +124,8 @@ __libio_codecvt_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_out.step_data.__statep = statep;
 
   __gconv_fct fct = gs->__fct;
-#ifdef PTR_DEMANGLE
   if (gs->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   status = DL_CALL_FCT (fct,
                        (gs, &codecvt->__cd_out.step_data, &from_start_copy,
@@ -176,10 +174,8 @@ __libio_codecvt_in (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_in.step_data.__statep = statep;
 
   __gconv_fct fct = gs->__fct;
-#ifdef PTR_DEMANGLE
   if (gs->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   status = DL_CALL_FCT (fct,
                        (gs, &codecvt->__cd_in.step_data, &from_start_copy,
@@ -243,10 +239,8 @@ __libio_codecvt_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
   codecvt->__cd_in.step_data.__statep = statep;
 
   __gconv_fct fct = gs->__fct;
-#ifdef PTR_DEMANGLE
   if (gs->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   DL_CALL_FCT (fct,
               (gs, &codecvt->__cd_in.step_data, &cp,
index dac3de7..3a5498b 100644 (file)
@@ -911,9 +911,7 @@ extern void (*IO_accept_foreign_vtables) (void) attribute_hidden;
 static inline void
 IO_set_accept_foreign_vtables (void (*flag) (void))
 {
-#ifdef PTR_MANGLE
   PTR_MANGLE (flag);
-#endif
   atomic_store_relaxed (&IO_accept_foreign_vtables, flag);
 }
 
index 32459e4..e3809c2 100644 (file)
@@ -39,9 +39,7 @@ _IO_vtable_check (void)
 #ifdef SHARED
   /* Honor the compatibility flag.  */
   void (*flag) (void) = atomic_load_relaxed (&IO_accept_foreign_vtables);
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (flag);
-#endif
   if (flag == &_IO_vtable_check)
     return;
 
index 45b7886..e8653bb 100644 (file)
@@ -86,19 +86,17 @@ __libc_unwind_link_get (void)
   assert (local.ptr__Unwind_Resume != NULL);
   assert (local.ptr_personality != NULL);
 
-#ifdef PTR_MANGLE
   PTR_MANGLE (local.ptr__Unwind_Backtrace);
   PTR_MANGLE (local.ptr__Unwind_ForcedUnwind);
   PTR_MANGLE (local.ptr__Unwind_GetCFA);
-# if UNWIND_LINK_GETIP
+#if UNWIND_LINK_GETIP
   PTR_MANGLE (local.ptr__Unwind_GetIP);
-# endif
+#endif
   PTR_MANGLE (local.ptr__Unwind_Resume);
-# if UNWIND_LINK_FRAME_STATE_FOR
+#if UNWIND_LINK_FRAME_STATE_FOR
   PTR_MANGLE (local.ptr___frame_state_for);
-# endif
-  PTR_MANGLE (local.ptr_personality);
 #endif
+  PTR_MANGLE (local.ptr_personality);
 
   __libc_lock_lock (lock);
   if (atomic_load_relaxed (&global_libgcc_handle) != NULL)
index 9a8f3dd..444facb 100644 (file)
@@ -128,10 +128,8 @@ module_load_builtin (struct nss_module *module,
     case nss_module_failed:
       bind (module->functions.untyped);
 
-#ifdef PTR_MANGLE
       for (int i = 0; i < nss_module_functions_count; ++i)
        PTR_MANGLE (module->functions.untyped[i]);
-#endif
 
       module->handle = NULL;
       /* Synchronizes with unlocked __nss_module_load atomic_load_acquire.  */
@@ -153,9 +151,7 @@ module_load_nss_files (struct nss_module *module)
   if (is_nscd)
     {
       void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
-# ifdef PTR_DEMANGLE
       PTR_DEMANGLE (cb);
-# endif
       _nss_files_init (cb);
     }
 #endif
@@ -239,9 +235,7 @@ module_load (struct nss_module *module)
         }
       pointers[idx] = __libc_dlsym (handle, function_name);
       free (function_name);
-#ifdef PTR_MANGLE
       PTR_MANGLE (pointers[idx]);
-#endif
     }
 
 # ifdef USE_NSCD
@@ -264,9 +258,7 @@ module_load (struct nss_module *module)
       if (ifct != NULL)
        {
          void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
-#  ifdef PTR_DEMANGLE
          PTR_DEMANGLE (cb);
-#  endif
          ifct (cb);
        }
     }
@@ -349,9 +341,7 @@ __nss_module_get_function (struct nss_module *module, const char *name)
   assert (name_entry != NULL);
   size_t idx = name_entry - nss_function_name_array;
   void *fptr = module->functions.untyped[idx];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (fptr);
-#endif
   return fptr;
 }
 
@@ -382,9 +372,7 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
 {
   void (*cb1) (size_t, struct traced_file *);
   cb1 = cb;
-# ifdef PTR_MANGLE
   PTR_MANGLE (cb);
-# endif
   nscd_init_cb = cb;
   is_nscd = true;
 
index adf89e9..fad2d2b 100644 (file)
@@ -49,9 +49,7 @@ __internal_atexit (void (*func) (void *), void *arg, void *d,
       return -1;
     }
 
-#ifdef PTR_MANGLE
   PTR_MANGLE (func);
-#endif
   new->func.cxa.fn = (void (*) (void *, int)) func;
   new->func.cxa.arg = arg;
   new->func.cxa.dso_handle = d;
index f247956..1958c28 100644 (file)
@@ -75,9 +75,8 @@ __cxa_finalize (void *d)
               parallel.  */
            f->flavor = ef_free;
 
-#ifdef PTR_DEMANGLE
            PTR_DEMANGLE (cxafn);
-#endif
+
            /* Unlock the list while we call a foreign function.  */
            __libc_lock_unlock (__exit_funcs_lock);
            cxafn (cxaarg, 0);
index faacab3..b5ecfee 100644 (file)
@@ -100,9 +100,7 @@ static __thread struct link_map *lm_cache;
 int
 __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
 {
-#ifdef PTR_MANGLE
   PTR_MANGLE (func);
-#endif
 
   /* Prepend.  */
   struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
@@ -152,9 +150,7 @@ __call_tls_dtors (void)
     {
       struct dtor_list *cur = tls_dtor_list;
       dtor_func func = cur->func;
-#ifdef PTR_DEMANGLE
       PTR_DEMANGLE (func);
-#endif
 
       tls_dtor_list = tls_dtor_list->next;
       func (cur->obj);
index e59156b..10c44e1 100644 (file)
@@ -81,9 +81,8 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
            case ef_on:
              onfct = f->func.on.fn;
              arg = f->func.on.arg;
-#ifdef PTR_DEMANGLE
              PTR_DEMANGLE (onfct);
-#endif
+
              /* Unlock the list while we call a foreign function.  */
              __libc_lock_unlock (__exit_funcs_lock);
              onfct (status, arg);
@@ -91,9 +90,8 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
              break;
            case ef_at:
              atfct = f->func.at;
-#ifdef PTR_DEMANGLE
              PTR_DEMANGLE (atfct);
-#endif
+
              /* Unlock the list while we call a foreign function.  */
              __libc_lock_unlock (__exit_funcs_lock);
              atfct ();
@@ -105,9 +103,8 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
              f->flavor = ef_free;
              cxafct = f->func.cxa.fn;
              arg = f->func.cxa.arg;
-#ifdef PTR_DEMANGLE
              PTR_DEMANGLE (cxafct);
-#endif
+
              /* Unlock the list while we call a foreign function.  */
              __libc_lock_unlock (__exit_funcs_lock);
              cxafct (arg, status);
index fb59db2..2ac70e1 100644 (file)
@@ -39,9 +39,7 @@ __on_exit (void (*func) (int status, void *arg), void *arg)
       return -1;
     }
 
-#ifdef PTR_MANGLE
   PTR_MANGLE (func);
-#endif
   new->func.on.fn = func;
   new->func.on.arg = arg;
   new->flavor = ef_on;
index 78bdd4a..841da96 100644 (file)
@@ -49,9 +49,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf jmpbuf)
 {
   uintptr_t sp = jmpbuf[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 #endif
index 318b73b..05a0dc9 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index e5434a9..2eadc5d 100644 (file)
@@ -35,9 +35,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf jmpbuf)
 {
   uintptr_t sp = jmpbuf[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 641444e..be99b4f 100644 (file)
@@ -33,9 +33,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[__JMP_BUF_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 76fca43..61e9c45 100644 (file)
@@ -36,9 +36,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = (uintptr_t) regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index a2076a2..ea031a0 100644 (file)
@@ -61,16 +61,12 @@ libc_hidden_proto (__libc_unwind_link_get)
 /* UNWIND_LINK_PTR returns the stored function pointer NAME from the
    cached unwind link OBJ (which was previously returned by
    __libc_unwind_link_get).  */
-# ifdef PTR_DEMANGLE
-#  define UNWIND_LINK_PTR(obj, name, ...)                          \
+# define UNWIND_LINK_PTR(obj, name, ...)                             \
   ({                                                                \
     __typeof ((obj)->ptr_##name) __unwind_fptr = (obj)->ptr_##name; \
     PTR_DEMANGLE (__unwind_fptr);                                   \
     __unwind_fptr;                                                  \
   })
-# else /* !PTR_DEMANGLE */
-#  define UNWIND_LINK_PTR(obj, name, ...) ((obj)->ptr_##name)
-# endif
 
 /* Called from fork, in the new subprocess.  */
 void __libc_unwind_link_after_fork (void);
index 73d214f..25b54f8 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index ae23469..bb2e878 100644 (file)
   local.ptr__Unwind_GetGR                                   \
     = __libc_dlsym (local_libgcc_handle, "_Unwind_GetGR");  \
   assert (local.ptr__Unwind_GetGR != NULL);
-#ifdef PTR_MANGLE
-# define UNWIND_LINK_EXTRA_INIT                 \
+#define UNWIND_LINK_EXTRA_INIT                  \
   UNWIND_LINK_EXTRA_INIT_SHARED                 \
   PTR_MANGLE (local.ptr__Unwind_GetGR);
-#else
-# define UNWIND_LINK_EXTRA_INIT UNWIND_LINK_EXTRA_INIT_SHARED
-#endif
 
 #endif /* _ARCH_UNWIND_LINK_H */
index 458edec..bd58dd7 100644 (file)
@@ -33,9 +33,7 @@
 static inline uintptr_t __attribute__ ((unused)) _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 3ee46c0..baf6f79 100644 (file)
@@ -33,9 +33,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = (uintptr_t) regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 2577fbf..1ac2815 100644 (file)
@@ -31,9 +31,7 @@
 static inline uintptr_t
 demangle_ptr (uintptr_t x)
 {
-# ifdef PTR_DEMANGLE
   PTR_DEMANGLE (x);
-# endif
   return x;
 }
 
index 302e950..79fc493 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   void *sp = (void *) regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return (uintptr_t) sp;
 }
 
index 28ecffe..827000a 100644 (file)
@@ -35,9 +35,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = (uintptr_t) regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 76fea64..50f938c 100644 (file)
@@ -38,9 +38,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf jmpbuf)
 {
   uintptr_t sp = jmpbuf[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 #endif
index 93573ce..8249959 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[JB_GPR1];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index b411a24..0aeb0a7 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[0].__sp;
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 10b37f0..d125f31 100644 (file)
@@ -41,9 +41,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   void *sp = (void *) (uintptr_t) regs[0].__gregs[__JB_GPR15];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return (uintptr_t) sp;
 }
 
index 83d4232..f0317f6 100644 (file)
 #include <unistd.h>
 #include <stap-probe.h>
 
+/* See sysdeps/unix/sysv/linux/s390/s390-32/pointer_guard.h.  */
+#if IS_IN (rtld)
+# undef PTR_DEMANGLE
+#endif
+
 /* Jump to the position specified by ENV, causing the
    setjmp call there to return VAL, or 1 if VAL is 0.  */
 void
index 9fe4939..eabe245 100644 (file)
 #include <unistd.h>
 #include <stap-probe.h>
 
+/* See sysdeps/unix/sysv/linux/s390/s390-64/pointer_guard.h.  */
+#if IS_IN (rtld)
+# undef PTR_DEMANGLE
+#endif
+
 /* Jump to the position specified by ENV, causing the
    setjmp call there to return VAL, or 1 if VAL is 0.  */
 void
index 1957e52..2c8b8b3 100644 (file)
@@ -33,9 +33,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   void *sp = (void *) regs[0].__regs[7];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return (uintptr_t) sp;
 }
 
index 8b697ed..a225a33 100644 (file)
@@ -34,9 +34,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[JB_SP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index c92b263..6fc5097 100644 (file)
@@ -36,9 +36,7 @@ static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
 {
   uintptr_t sp = regs[JB_RSP];
-#ifdef PTR_DEMANGLE
   PTR_DEMANGLE (sp);
-#endif
   return sp;
 }
 
index 7023ec9..da1c287 100644 (file)
@@ -45,10 +45,8 @@ __btowc (int c)
   /* Get the conversion functions.  */
   fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
   __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct;
-#ifdef PTR_DEMANGLE
   if (fcts->towc->__shlib_handle != NULL)
     PTR_DEMANGLE (btowc_fct);
-#endif
 
   if (__builtin_expect (fcts->towc_nsteps == 1, 1)
       && __builtin_expect (btowc_fct != NULL, 1))
@@ -81,10 +79,8 @@ __btowc (int c)
       inbuf[0] = c;
 
       __gconv_fct fct = fcts->towc->__fct;
-#ifdef PTR_DEMANGLE
       if (fcts->towc->__shlib_handle != NULL)
        PTR_DEMANGLE (fct);
-#endif
       status = DL_CALL_FCT (fct, (fcts->towc, &data, &inptr, inptr + 1,
                                  NULL, &dummy, 0, 1));
 
index f8b029b..f45f73e 100644 (file)
@@ -96,10 +96,8 @@ mbrtoc16 (char16_t *pc16, const char *s, size_t n, mbstate_t *ps)
        goto ilseq;
     }
   __gconv_fct fct = fcts->towc->__fct;
-#ifdef PTR_DEMANGLE
   if (fcts->towc->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   status = DL_CALL_FCT (fct, (fcts->towc, &data, &inbuf, endbuf,
                              NULL, &dummy, 0, 1));
index 46a1cc3..3d06acb 100644 (file)
@@ -78,10 +78,8 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
        goto ilseq;
     }
   __gconv_fct fct = fcts->towc->__fct;
-#ifdef PTR_DEMANGLE
   if (fcts->towc->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
   status = DL_CALL_FCT (fct, (fcts->towc, &data, &inbuf, endbuf,
                              NULL, &dummy, 0, 1));
 
index 06a1f2d..47f5de4 100644 (file)
@@ -64,10 +64,8 @@ __mbsnrtowcs (wchar_t *dst, const char **src, size_t nmc, size_t len,
   /* Get the structure with the function pointers.  */
   towc = fcts->towc;
   __gconv_fct fct = towc->__fct;
-#ifdef PTR_DEMANGLE
   if (towc->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
index 526b88e..5fe70cb 100644 (file)
@@ -58,10 +58,8 @@ __mbsrtowcs_l (wchar_t *dst, const char **src, size_t len, mbstate_t *ps,
   /* Get the structure with the function pointers.  */
   towc = fcts->towc;
   __gconv_fct fct = towc->__fct;
-#ifdef PTR_DEMANGLE
   if (towc->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
index 42690f2..b71ca79 100644 (file)
@@ -63,10 +63,8 @@ __wcrtomb_internal (char *s, wchar_t wc, mbstate_t *ps, size_t s_size)
   /* Get the conversion functions.  */
   fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
   __gconv_fct fct = fcts->tomb->__fct;
-#ifdef PTR_DEMANGLE
   if (fcts->tomb->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* If WC is the NUL character we write into the output buffer the byte
      sequence necessary for PS to get into the initial state, followed
index 6ba180c..12b116a 100644 (file)
@@ -62,10 +62,8 @@ __wcsnrtombs (char *dst, const wchar_t **src, size_t nwc, size_t len,
   /* Get the structure with the function pointers.  */
   tomb = fcts->tomb;
   __gconv_fct fct = tomb->__fct;
-#ifdef PTR_DEMANGLE
   if (tomb->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
index 7db2b18..962176c 100644 (file)
@@ -54,10 +54,8 @@ __wcsrtombs (char *dst, const wchar_t **src, size_t len, mbstate_t *ps)
   /* Get the structure with the function pointers.  */
   tomb = fcts->tomb;
   __gconv_fct fct = tomb->__fct;
-#ifdef PTR_DEMANGLE
   if (tomb->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
 
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
index 5dfbd7a..63764d1 100644 (file)
@@ -63,10 +63,8 @@ wctob (wint_t c)
 
   const unsigned char *argptr = (const unsigned char *) inptr;
   __gconv_fct fct = fcts->tomb->__fct;
-#ifdef PTR_DEMANGLE
   if (fcts->tomb->__shlib_handle != NULL)
     PTR_DEMANGLE (fct);
-#endif
   status = DL_CALL_FCT (fct,
                        (fcts->tomb, &data, &argptr,
                         argptr + sizeof (inbuf[0]), NULL, &dummy, 0, 1));