public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc64: Remove strcspn ifunc from the loader
@ 2021-07-02 19:32 Tulio Magno Quites Machado Filho
  2021-07-02 19:56 ` Paul E Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2021-07-02 19:32 UTC (permalink / raw)
  To: libc-alpha; +Cc: Anton Blanchard

5 years ago, commit 8f1b841e452dbb083112fd036033b7f4af506ba0
unintentionally added an ifunc to the loader.
That modification has not caused any harm so far, but it doesn't add any
value either, because the hwcap information is available later during
libc initialization.

Suggested-by: Anton Blanchard <anton@ozlabs.org>
---
 .../powerpc/powerpc64/multiarch/rtld-strcspn.c | 18 ++++++++++++++++++
 sysdeps/powerpc/powerpc64/multiarch/strcspn.c  |  2 ++
 2 files changed, 20 insertions(+)
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c

diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c
new file mode 100644
index 0000000000..fcb9682e58
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <string/strcspn.c>
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
index 683aa104d7..bb4d54620f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#if IS_IN (libc)
 #include <string.h>
 #include <shlib-compat.h>
 #include "init-arch.h"
@@ -33,3 +34,4 @@ libc_ifunc (__libc_strcspn,
 
 weak_alias (__libc_strcspn, strcspn)
 libc_hidden_builtin_def (strcspn)
+#endif
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc64: Remove strcspn ifunc from the loader
  2021-07-02 19:32 [PATCH] powerpc64: Remove strcspn ifunc from the loader Tulio Magno Quites Machado Filho
@ 2021-07-02 19:56 ` Paul E Murphy
  2021-07-08 21:31   ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E Murphy @ 2021-07-02 19:56 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho, libc-alpha; +Cc: Anton Blanchard



On 7/2/21 2:32 PM, Tulio Magno Quites Machado Filho via Libc-alpha wrote:
> 5 years ago, commit 8f1b841e452dbb083112fd036033b7f4af506ba0
> unintentionally added an ifunc to the loader.
> That modification has not caused any harm so far, but it doesn't add any
> value either, because the hwcap information is available later during
> libc initialization.

Oh, oops. Thanks for fixing this!

> Suggested-by: Anton Blanchard <anton@ozlabs.org>
> ---
>   .../powerpc/powerpc64/multiarch/rtld-strcspn.c | 18 ++++++++++++++++++
>   sysdeps/powerpc/powerpc64/multiarch/strcspn.c  |  2 ++
>   2 files changed, 20 insertions(+)
>   create mode 100644 sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c
> 
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c
> new file mode 100644
> index 0000000000..fcb9682e58
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/multiarch/rtld-strcspn.c
> @@ -0,0 +1,18 @@
> +/* Copyright (C) 2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <string/strcspn.c>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
> index 683aa104d7..bb4d54620f 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
> @@ -16,6 +16,7 @@
>      License along with the GNU C Library; if not, see
>      <https://www.gnu.org/licenses/>.  */
> 
> +#if IS_IN (libc)
>   #include <string.h>
>   #include <shlib-compat.h>
>   #include "init-arch.h"
> @@ -33,3 +34,4 @@ libc_ifunc (__libc_strcspn,
> 
>   weak_alias (__libc_strcspn, strcspn)
>   libc_hidden_builtin_def (strcspn)
> +#endif

Is the macro guard needed if you're directly bypassing via 
rtld-strcspn.c above? Otherwise, LGTM either way.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc64: Remove strcspn ifunc from the loader
  2021-07-02 19:56 ` Paul E Murphy
@ 2021-07-08 21:31   ` Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2021-07-08 21:31 UTC (permalink / raw)
  To: Paul E Murphy, libc-alpha; +Cc: Anton Blanchard

Paul E Murphy via Libc-alpha <libc-alpha@sourceware.org> writes:

> On 7/2/21 2:32 PM, Tulio Magno Quites Machado Filho via Libc-alpha wrote:
>> diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
>> index 683aa104d7..bb4d54620f 100644
>> --- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
>> +++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
>> @@ -16,6 +16,7 @@
>>      License along with the GNU C Library; if not, see
>>      <https://www.gnu.org/licenses/>.  */
>> 
>> +#if IS_IN (libc)
>>   #include <string.h>
>>   #include <shlib-compat.h>
>>   #include "init-arch.h"
>> @@ -33,3 +34,4 @@ libc_ifunc (__libc_strcspn,
>> 
>>   weak_alias (__libc_strcspn, strcspn)
>>   libc_hidden_builtin_def (strcspn)
>> +#endif
>
> Is the macro guard needed if you're directly bypassing via 
> rtld-strcspn.c above? Otherwise, LGTM either way.

No, it isn't.
I'm removing it.

Thanks!

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-08 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 19:32 [PATCH] powerpc64: Remove strcspn ifunc from the loader Tulio Magno Quites Machado Filho
2021-07-02 19:56 ` Paul E Murphy
2021-07-08 21:31   ` Tulio Magno Quites Machado Filho

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