sh: Fix static build with --enable-fortify

Message ID 20240116165459.2707906-1-adhemerval.zanella@linaro.org
State Committed
Commit bcf2abd43bbe6ffdd8b6a1e1e36cc67a9769e508
Headers
Series sh: Fix static build with --enable-fortify |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed

Commit Message

Adhemerval Zanella Netto Jan. 16, 2024, 4:54 p.m. UTC
  For static the internal symbols should not be prepended with the
internal __GI_.

Checked with a make check for sh4-linux-gnu.
---
 sysdeps/unix/sysv/linux/sh/____longjmp_chk.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella Netto Jan. 22, 2024, 1:04 p.m. UTC | #1
On 16/01/24 13:54, Adhemerval Zanella wrote:
> For static the internal symbols should not be prepended with the
> internal __GI_.
> 
> Checked with a make check for sh4-linux-gnu.

I will commit this shortly if no one opposes it.

> ---
>  sysdeps/unix/sysv/linux/sh/____longjmp_chk.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
> index ede6551bcc..f61db0bc63 100644
> --- a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
> +++ b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
> @@ -53,7 +53,7 @@ longjmp_msg:
>  .Lstr:							\
>  	.long	longjmp_msg@GOTOFF;			\
>  .Lfail:							\
> -	.long	__GI___fortify_fail@PLT-(.Lfail0-.);	\
> +	.long	HIDDEN_JUMPTARGET(__fortify_fail)@PLT-(.Lfail0-.); \
>  	cfi_restore_state;
>  #else
>  # define CALL_FAIL \
> @@ -70,7 +70,7 @@ longjmp_msg:
>  .Lstr:							\
>  	.long	longjmp_msg;				\
>  .Lfail:							\
> -	.long	__fortify_fail;				\
> +	.long	HIDDEN_JUMPTARGET(__fortify_fail);	\
>  	cfi_restore_state;
>  #endif
>
  
Andreas K. Huettel Jan. 22, 2024, 2:46 p.m. UTC | #2
Am Montag, 22. Januar 2024, 14:04:32 CET schrieb Adhemerval Zanella Netto:
> 
> On 16/01/24 13:54, Adhemerval Zanella wrote:
> > For static the internal symbols should not be prepended with the
> > internal __GI_.
> > 
> > Checked with a make check for sh4-linux-gnu.
> 
> I will commit this shortly if no one opposes it.
> 
please do
  

Patch

diff --git a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
index ede6551bcc..f61db0bc63 100644
--- a/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/sh/____longjmp_chk.S
@@ -53,7 +53,7 @@  longjmp_msg:
 .Lstr:							\
 	.long	longjmp_msg@GOTOFF;			\
 .Lfail:							\
-	.long	__GI___fortify_fail@PLT-(.Lfail0-.);	\
+	.long	HIDDEN_JUMPTARGET(__fortify_fail)@PLT-(.Lfail0-.); \
 	cfi_restore_state;
 #else
 # define CALL_FAIL \
@@ -70,7 +70,7 @@  longjmp_msg:
 .Lstr:							\
 	.long	longjmp_msg;				\
 .Lfail:							\
-	.long	__fortify_fail;				\
+	.long	HIDDEN_JUMPTARGET(__fortify_fail);	\
 	cfi_restore_state;
 #endif