public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4243] libgcc: use .init_stack for constructors if available
@ 2021-10-08 3:24 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2021-10-08 3:24 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f49e3d28be44179f07b8a06159139ce77096dda7
commit r12-4243-gf49e3d28be44179f07b8a06159139ce77096dda7
Author: Ian Lance Taylor <iant@golang.org>
Date: Thu Oct 7 20:22:25 2021 -0700
libgcc: use .init_stack for constructors if available
* config/i386/morestack.S: Use .init_array for constructor if
available.
* config/rs6000/morestack.S: Likewise.
* config/s390/morestack.S: Likewise.
Diff:
---
libgcc/config/i386/morestack.S | 13 +++++++++----
libgcc/config/rs6000/morestack.S | 6 ++++++
libgcc/config/s390/morestack.S | 6 ++++++
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S
index 718dbb1d5d2..2e748eda8a7 100644
--- a/libgcc/config/i386/morestack.S
+++ b/libgcc/config/i386/morestack.S
@@ -23,6 +23,7 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
+#include "auto-host.h"
# Support for allocating more stack space when using -fsplit-stack.
# When a function discovers that it needs more stack space, it will
@@ -75,7 +76,7 @@
# The amount of extra space we ask for. In general this has to be
# enough for the dynamic loader to find a symbol and for a signal
# handler to run.
-
+
#ifndef __x86_64__
#define BACKOFF (1024)
#else
@@ -160,7 +161,7 @@ __morestack_non_split:
cmpb $0x55,1(%eax)
je 2f
-3:
+3:
movl %eax,4(%esp) # Update return address.
popl %eax # Restore %eax and stack.
@@ -426,7 +427,7 @@ __morestack:
# This is the cleanup code called by the stack unwinder when unwinding
# through the code between .LEHB0 and .LEHE0 above.
-
+
.L1:
.cfi_restore_state
subl $16,%esp # Maintain 16 byte alignment.
@@ -600,7 +601,7 @@ __morestack:
# This is the cleanup code called by the stack unwinder when unwinding
# through the code between .LEHB0 and .LEHE0 above.
-
+
.L1:
.cfi_restore_state
subq $16,%rsp # Maintain 16 byte alignment.
@@ -848,7 +849,11 @@ __morestack_make_guard:
# Make __stack_split_initialize a high priority constructor. FIXME:
# This is ELF specific.
+#if HAVE_INITFINI_ARRAY_SUPPORT
+ .section .init_array.00000,"aw",@progbits
+#else
.section .ctors.65535,"aw",@progbits
+#endif
#ifndef __LP64__
.align 4
diff --git a/libgcc/config/rs6000/morestack.S b/libgcc/config/rs6000/morestack.S
index a2e255e5c21..509e506a6de 100644
--- a/libgcc/config/rs6000/morestack.S
+++ b/libgcc/config/rs6000/morestack.S
@@ -24,6 +24,8 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
+#include <auto-host.h>
+
#if _CALL_ELF == 2
.abiversion 2
#define PARAMS 32
@@ -396,7 +398,11 @@ ENTRY0(__morestack_make_guard)
# Make __stack_split_initialize a high priority constructor.
+#if HAVE_INITFINI_ARRAY_SUPPORT
+ .section .init_array.00000,"aw",@progbits
+#else
.section .ctors.65535,"aw",@progbits
+#endif
.p2align 3
.quad __stack_split_initialize
.quad __morestack_load_mmap
diff --git a/libgcc/config/s390/morestack.S b/libgcc/config/s390/morestack.S
index 80349fd869c..d873de90d12 100644
--- a/libgcc/config/s390/morestack.S
+++ b/libgcc/config/s390/morestack.S
@@ -28,6 +28,8 @@
# also cover signal frame size.
#define BACKOFF 0x1000
+#include <auto-host.h>
+
# The __morestack function.
.global __morestack
@@ -594,7 +596,11 @@ __morestack_make_guard:
# Make __stack_split_initialize a high priority constructor.
+#if HAVE_INITFINI_ARRAY_SUPPORT
+ .section .init_array.00000,"aw",@progbits
+#else
.section .ctors.65535,"aw",@progbits
+#endif
#ifndef __LP64__
.align 4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-08 3:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 3:24 [gcc r12-4243] libgcc: use .init_stack for constructors if available Ian Lance Taylor
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).