Use PTR_MANGLE and PTR_DEMANGLE unconditionally in C sources

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>
This commit is contained in:
Florian Weimer 2022-10-18 17:00:07 +02:00
parent 88f4b6929c
commit 58548b9d68
50 changed files with 22 additions and 160 deletions

View 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;
}

View 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)
{

View 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
}
}

View 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
}
}
}

View 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;

View 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. */

View 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

View 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)
{

View 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;

View 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,

View 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);
}

View 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;

View 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
PTR_MANGLE (local.ptr__Unwind_Resume);
# if UNWIND_LINK_FRAME_STATE_FOR
PTR_MANGLE (local.ptr___frame_state_for);
# endif
PTR_MANGLE (local.ptr_personality);
#endif
PTR_MANGLE (local.ptr__Unwind_Resume);
#if UNWIND_LINK_FRAME_STATE_FOR
PTR_MANGLE (local.ptr___frame_state_for);
#endif
PTR_MANGLE (local.ptr_personality);
__libc_lock_lock (lock);
if (atomic_load_relaxed (&global_libgcc_handle) != NULL)

View 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;

View 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;

View 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);

View 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);

View 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);

View 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;

View 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

View 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;
}

View 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;
}

View 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;
}

View 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;
}

View 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);

View 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;
}

View File

@ -28,12 +28,8 @@
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 */

View 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;
}

View 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;
}

View File

@ -31,9 +31,7 @@
static inline uintptr_t
demangle_ptr (uintptr_t x)
{
# ifdef PTR_DEMANGLE
PTR_DEMANGLE (x);
# endif
return x;
}

View 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;
}

View 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;
}

View 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

View 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;
}

View 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;
}

View 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;
}

View File

@ -24,6 +24,11 @@
#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

View File

@ -24,6 +24,11 @@
#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

View 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;
}

View 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;
}

View 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;
}

View 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));

View 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));

View 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));

View 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)

View 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)

View 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

View 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)

View 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)

View 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));