public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780)
@ 2015-04-23 16:37 Jakub Jelinek
  2015-04-23 18:13 ` Ramana Radhakrishnan
  2015-04-24  8:56 ` Marcus Shawcroft
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2015-04-23 16:37 UTC (permalink / raw)
  To: Andreas Krebbel, Marcus Shawcroft, Richard Earnshaw,
	Ramana Radhakrishnan, Richard Henderson
  Cc: gcc-patches

Hi!

This patch undoes the PR65780 performance regressions on a few targets
I have tested to work fine.
This PR was about an access to uninitialized COMMON symbol defined in
executable (or PIE) where there is a normal symbol definition in a shared
library.  The PR65780 fix that got committed stopped treating
such COMMONs as binding local on all architectures, except for i?86 (for
normal execs only) and x86_64 (for normal execs and PIEs, but the latter
only with recent linker).  As s390/arm/aarch64 seems to work fine
(generate a COPY relocation and thus define symbol locally) in non-PIE
executables, this patch changes those to a function that has been added for
that behavior.  E.g. powerpc64{,le} on the other side isn't able to link
that case neither in normal execs nor PIEs.

Bootstrapped/regtested on
{x86_64,i686,armv7hl,aarch64,s390{,x},powerpc64{,le}}-linux, ok for trunk
(and perhaps after a while for 5.2)?

2015-04-23  Jakub Jelinek  <jakub@redhat.com>

	PR target/65780
	* config/s390/linux.h (TARGET_BINDS_LOCAL_P): Define to
	default_binds_local_p_2.
	* config/arm/linux-elf.h (TARGET_BINDS_LOCAL_P): Likewise.
	* config/aarch64/aarch64-linux.h (TARGET_BINDS_LOCAL_P): Likewise.

--- gcc/config/s390/linux.h.jj	2015-01-05 13:07:16.000000000 +0100
+++ gcc/config/s390/linux.h	2015-04-22 17:39:38.880273650 +0200
@@ -90,4 +90,10 @@ along with GCC; see the file COPYING3.
 #undef TARGET_LIBC_HAS_FUNCTION
 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
 
+/* Uninitialized common symbols in non-PIE executables, even with
+   strong definitions in dependent shared libraries, will resolve
+   to COPY relocated symbol in the executable.  See PR65780.  */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
+
 #endif
--- gcc/config/arm/linux-elf.h.jj	2015-01-05 13:07:16.000000000 +0100
+++ gcc/config/arm/linux-elf.h	2015-04-22 17:42:35.979420149 +0200
@@ -118,3 +118,9 @@
 /* Add .note.GNU-stack.  */
 #undef NEED_INDICATE_EXEC_STACK
 #define NEED_INDICATE_EXEC_STACK	1
+
+/* Uninitialized common symbols in non-PIE executables, even with
+   strong definitions in dependent shared libraries, will resolve
+   to COPY relocated symbol in the executable.  See PR65780.  */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
--- gcc/config/aarch64/aarch64-linux.h.jj	2015-01-05 13:07:17.000000000 +0100
+++ gcc/config/aarch64/aarch64-linux.h	2015-04-22 17:40:46.395185820 +0200
@@ -69,4 +69,10 @@
 
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
+/* Uninitialized common symbols in non-PIE executables, even with
+   strong definitions in dependent shared libraries, will resolve
+   to COPY relocated symbol in the executable.  See PR65780.  */
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
+
 #endif  /* GCC_AARCH64_LINUX_H */

	Jakub

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

* Re: [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780)
  2015-04-23 16:37 [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780) Jakub Jelinek
@ 2015-04-23 18:13 ` Ramana Radhakrishnan
  2015-04-24  8:56 ` Marcus Shawcroft
  1 sibling, 0 replies; 3+ messages in thread
From: Ramana Radhakrishnan @ 2015-04-23 18:13 UTC (permalink / raw)
  To: Jakub Jelinek, Andreas Krebbel, Marcus Shawcroft,
	Richard Earnshaw, Richard Henderson
  Cc: gcc-patches



On 23/04/15 17:36, Jakub Jelinek wrote:
> Hi!
>
> This patch undoes the PR65780 performance regressions on a few targets
> I have tested to work fine.
> This PR was about an access to uninitialized COMMON symbol defined in
> executable (or PIE) where there is a normal symbol definition in a shared
> library.  The PR65780 fix that got committed stopped treating
> such COMMONs as binding local on all architectures, except for i?86 (for
> normal execs only) and x86_64 (for normal execs and PIEs, but the latter
> only with recent linker).  As s390/arm/aarch64 seems to work fine
> (generate a COPY relocation and thus define symbol locally) in non-PIE
> executables, this patch changes those to a function that has been added for
> that behavior.  E.g. powerpc64{,le} on the other side isn't able to link
> that case neither in normal execs nor PIEs.
>
> Bootstrapped/regtested on
> {x86_64,i686,armv7hl,aarch64,s390{,x},powerpc64{,le}}-linux, ok for trunk
> (and perhaps after a while for 5.2)?

The ARM bits are OK.

regards
Ramana


>
> 2015-04-23  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR target/65780
> 	* config/s390/linux.h (TARGET_BINDS_LOCAL_P): Define to
> 	default_binds_local_p_2.
> 	* config/arm/linux-elf.h (TARGET_BINDS_LOCAL_P): Likewise.
> 	* config/aarch64/aarch64-linux.h (TARGET_BINDS_LOCAL_P): Likewise.
>
> --- gcc/config/s390/linux.h.jj	2015-01-05 13:07:16.000000000 +0100
> +++ gcc/config/s390/linux.h	2015-04-22 17:39:38.880273650 +0200
> @@ -90,4 +90,10 @@ along with GCC; see the file COPYING3.
>   #undef TARGET_LIBC_HAS_FUNCTION
>   #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
>
> +/* Uninitialized common symbols in non-PIE executables, even with
> +   strong definitions in dependent shared libraries, will resolve
> +   to COPY relocated symbol in the executable.  See PR65780.  */
> +#undef TARGET_BINDS_LOCAL_P
> +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
> +
>   #endif
> --- gcc/config/arm/linux-elf.h.jj	2015-01-05 13:07:16.000000000 +0100
> +++ gcc/config/arm/linux-elf.h	2015-04-22 17:42:35.979420149 +0200
> @@ -118,3 +118,9 @@
>   /* Add .note.GNU-stack.  */
>   #undef NEED_INDICATE_EXEC_STACK
>   #define NEED_INDICATE_EXEC_STACK	1
> +
> +/* Uninitialized common symbols in non-PIE executables, even with
> +   strong definitions in dependent shared libraries, will resolve
> +   to COPY relocated symbol in the executable.  See PR65780.  */
> +#undef TARGET_BINDS_LOCAL_P
> +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
> --- gcc/config/aarch64/aarch64-linux.h.jj	2015-01-05 13:07:17.000000000 +0100
> +++ gcc/config/aarch64/aarch64-linux.h	2015-04-22 17:40:46.395185820 +0200
> @@ -69,4 +69,10 @@
>
>   #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
>
> +/* Uninitialized common symbols in non-PIE executables, even with
> +   strong definitions in dependent shared libraries, will resolve
> +   to COPY relocated symbol in the executable.  See PR65780.  */
> +#undef TARGET_BINDS_LOCAL_P
> +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2
> +
>   #endif  /* GCC_AARCH64_LINUX_H */
>
> 	Jakub
>

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

* Re: [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780)
  2015-04-23 16:37 [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780) Jakub Jelinek
  2015-04-23 18:13 ` Ramana Radhakrishnan
@ 2015-04-24  8:56 ` Marcus Shawcroft
  1 sibling, 0 replies; 3+ messages in thread
From: Marcus Shawcroft @ 2015-04-24  8:56 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Andreas Krebbel, Marcus Shawcroft, Richard Earnshaw,
	Ramana Radhakrishnan, Richard Henderson, gcc-patches

On 23 April 2015 at 17:36, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> This patch undoes the PR65780 performance regressions on a few targets
> I have tested to work fine.
> This PR was about an access to uninitialized COMMON symbol defined in
> executable (or PIE) where there is a normal symbol definition in a shared
> library.  The PR65780 fix that got committed stopped treating
> such COMMONs as binding local on all architectures, except for i?86 (for
> normal execs only) and x86_64 (for normal execs and PIEs, but the latter
> only with recent linker).  As s390/arm/aarch64 seems to work fine
> (generate a COPY relocation and thus define symbol locally) in non-PIE
> executables, this patch changes those to a function that has been added for
> that behavior.  E.g. powerpc64{,le} on the other side isn't able to link
> that case neither in normal execs nor PIEs.

>         * config/aarch64/aarch64-linux.h (TARGET_BINDS_LOCAL_P): Likewise.

AArch64 chunk is fine with me. Cheers /Marcus

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

end of thread, other threads:[~2015-04-24  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23 16:37 [PATCH] Improve targetm.binds_local_p for common symbols on s390*/arm/aarch64 (PR target/65780) Jakub Jelinek
2015-04-23 18:13 ` Ramana Radhakrishnan
2015-04-24  8:56 ` Marcus Shawcroft

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