]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
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 28213091e3e0b17c12e41501571f58c486dd8349..f114990b6f22aa820583ee7bba9dcfb7ec7b9e01 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 dea9c80fee0ca8836f4a83958da62886362d3e54..592a75956c20901216e24d75d4c26895dc355c92 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 5dbf596b8df48b4450317ba319ece496dfcc095c..8d47545c41ad1cce4c611bd6b3b9119bdf1a8b4a 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 90037fdf58d7da8235a85bb6e8e56fc2efd0f8e5..4943c954a333a9be443315f8ff6c971c483b4415 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 c93c5dd3808071398be5fc083a19661034e00a73..5ed982636a37137a74d8dd5fb145bd3a12687d3a 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 0f4ce109963835e2067633341a91aba8933b46f9..2255531452353d73c930536ebc441c30cc90824b 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 42ee0b650875091daece66da4fb824847e253ed6..9eaf9a49481d43fac6310e53c5fd59952cb67b63 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 df5811fd6a190a611b877fe270a1784de396ab84..2243d3e7d9246e6c69cfd29728b72b4694934800 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 a7db4ef1c97432b050669d9665d6c46791f275a7..6c276103197b5715bd792452096f298cfc275dcf 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 1ce685f48a773177fc38f3e146867552eb8ce350..37c353e3aaa6f92e7767e2cb6f5d0f75f4e88275 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 dac3de73a138f0d46818d8053dea0b78785e1374..3a5498bd658d50b2e8433faeb3de259d41c00a6e 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 32459e4faca4c7d76580445b4f6f7972578c6557..e3809c28cee7e01c6e4131a881056e49ae31d809 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 45b7886b46d85a25a5b80d52f8f2e23d6a448c80..e8653bbaf1b75b79b8e7eaf0d409e39ae87d35a0 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 9a8f3ddf949957c240185b2f9af9d528f4b6745f..444facb9b86bfd0db47a7600edf15ce5adcd3896 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 adf89e93f52c9a0c90cd8c0dea1550168f18a550..fad2d2b4e0538c3d595a7c1ac81337073634963f 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 f2479569a58d4ea02aae8193326cab82a1fe7c08..1958c28801c7985f566db24a37fe0de34cb6a99c 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 faacab39907e865889cc0d0d203270a5410ce57d..b5ecfee10c67731eb639ca7a6dc456ac435bacb0 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 e59156bbf602dee076b5aaf8b00067f37d282135..10c44e1449e5fa7aa57dc8c290d6a8e13efff5bb 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 fb59db20cab9cd6166acefbb1966cadae6ed2d42..2ac70e18bdb4d8a546822e00e2c1f1887759cc50 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 78bdd4a5398f8491ec9b512a178a6dccf65bf06d..841da965a690af3e6187d808176e7b6408cf1472 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 318b73b100aabbfa071e116f17565a3bccd2fc3b..05a0dc9cba20f6951cd429562af600d9eaf46512 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 e5434a95dd13e9cc674e7644e1b7acaace27a365..2eadc5d22fa45f64bfeaf16e056b5c397a097771 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 641444eaf39210b1f4d5b2b169b76a15a4d65b41..be99b4f9beaf2d12fb5e8ef5a6c7fe8f98639459 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 76fca431c63399b537940e08df34f60fb57d6031..61e9c45875176c201ed4c3adec918365d3a1cdcb 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 a2076a23bfd4d188afbd9fcd36132a467a279b75..ea031a04d0328083cef0328505bb41e135389ada 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 73d214fd31e4a3cd86b2ea57237168b698c0ac3c..25b54f8bb0e74eb4521179162ebb243e0315365c 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 ae23469d3f80fb21441bc5a35d1fd07b5cbdcfa4..bb2e878dd087a2fb962e6ea0829d4136377c504f 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 458edec1353a7e35ed186dbd99d3adfc0f1316d9..bd58dd7cc5b91bafe8123491f2cdbd904a83ecbf 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 3ee46c050c0885df48679707e4abdf4bc43b60f9..baf6f79b88d48db30f5b24327c96356dd7ab3229 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 2577fbf3eefb06297d8b837249e8336dca7700ca..1ac2815aac9ece259519e817645522818ca12435 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 302e950ced4a48beb6c9f98627ca93f23040d59a..79fc493971eefb275704c0d59594564e6bf81a1c 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 28ecffedb0fd019fa77f3edd6d6cda185ba20974..827000a72912c6aa64970eed87faef0671d6c689 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 76fea64ffecafe898a2458a80304b0cfa618b120..50f938c8cfd3396aa4821d55e1e095764724bcda 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 93573ce23850931af08a1a6050709ccbf8852977..82499594a3a6c141a371cb551097319a9a7bd76c 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 b411a246d1923ca3cf4deca2b8800d0d17fd1117..0aeb0a76c699e7e92f47d9ad14ef53294581c860 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 10b37f09c3f1396bc2eb27486ebb9eb5907a8af3..d125f3100aa43d79dd1e92c5c380c73c56639c7c 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 83d42329a3935d5f2277e98d8e03f2e19d1bb6bc..f0317f6a035844c7a3a15328e807d4174262f687 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 9fe4939e5ed018d956db3ffe326d5af6fa85c3ca..eabe245d95a4d8ceb4c53d9ffc22d08cab855a00 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 1957e5275d8d1e8d618b5c18dc5a1302f92e1f75..2c8b8b3696627ef4785bcd373e90e98e81716688 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 8b697ed95bc9c94d0b4bd5d5e6f751e942138645..a225a33dc52ad6217c9e2aae9374446c9e13a250 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 c92b2633bcd6f056ce7262b0df94e1be2c79dae0..6fc5097e114c4977efe379b0e258d1eeb50f8078 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 7023ec99f15d3ce777ed12f0dfc40f760c540c04..da1c28732f51d32e26d99661d0b472eb7aeadd44 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 f8b029b58a81e0c68d4b8ccb5ffa432a94519d0f..f45f73e246e68cafd63503ca2e880519aa4e4a87 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 46a1cc38dfbcb2c27ac10d4f03c24169994fa8b9..3d06acbd5a96ada90046c866f5a2b1129291842c 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 06a1f2d36f8a106e7c276231637392c12187aee7..47f5de408ac4eb3d1fc9e51b5cb3622a43720c28 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 526b88e1dd37526fb0e09ecacd5221e404d487eb..5fe70cb8a1191937cbc48b54f00a657282fbc612 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 42690f2efdc05a15d802e55510f82bfdc3591635..b71ca79de7cf01f8491a71032c2ef5b8d2a888ed 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 6ba180cdc2bbcae5caf664cbf13d1b28bcaa90de..12b116a837c4b437aff02d7a5aa9704b6720854d 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 7db2b181b399796f502250d5d4a55afe318c048f..962176c18338af9fb7c0a4b6a02888c5357cacf9 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 5dfbd7ab7e4141c7e7d6a539dcca2785bb5b615b..63764d1425dc7108cfc2ab529d2e7657133c3763 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));