about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-15 08:41:43 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-04-17 16:12:40 -0300
commit5e40fc59009c7247b974d161ba50da4c237b66a6 (patch)
tree22df877a61588061198c5a61c2eda81b651095be /include
parent706b3d7a47bb50f3534551f41e39bbaa9a5b9924 (diff)
downloadglibc-5e40fc59009c7247b974d161ba50da4c237b66a6.tar.gz
glibc-5e40fc59009c7247b974d161ba50da4c237b66a6.tar.xz
glibc-5e40fc59009c7247b974d161ba50da4c237b66a6.zip
string: Use asm alias instead of symbol redirections for stpcpy and mempcpy
Commit 939da411433 added symbols redirections to handle ISO C
namespace, however some compiler does not support to redeclare the
function prototype.  Moving these defintions to exported header
it not a good practice (it exposes a internal implementation and
it would require to add macros to define it only internally).

Instead this patch replaces the symbol redirections by direct asm
aliases, as done to handle libcall generation done by compiler on
some loop optimizations. The only issue is sparc binutils generates
an extra __mempcpy plt not called anywhere in the code, which indicates
a binutils issue (this is added in the localplt.data for now).

Checked on all affected ABIs.
Diffstat (limited to 'include')
-rw-r--r--include/string.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/string.h b/include/string.h
index 3b4c6007d7..082865caad 100644
--- a/include/string.h
+++ b/include/string.h
@@ -179,8 +179,8 @@ extern __typeof (strsep) strsep attribute_hidden;
   && !defined NO_MEMPCPY_STPCPY_REDIRECT
 /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
    __mempcpy and __stpcpy if not inlined.  */
-extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
-extern __typeof (stpcpy) stpcpy __asm__ ("__stpcpy");
+__asm__ ("mempcpy = __mempcpy");
+__asm__ ("stpcpy = __stpcpy");
 #endif
 
 extern void *__memcpy_chk (void *__restrict __dest,