This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] LynxOS/PowerPC, work with text segment >32M
- From: Adam Nemet <anemet at lnxw dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Jul 2005 18:55:40 -0700
- Subject: [PATCH] LynxOS/PowerPC, work with text segment >32M
Hi,
The testcase below fails on PowerPC with LynxOS.
int pad ()
{
asm (".space 0x02000000");
}
int main ()
{
puts ("ok");
}
The problem is that the call to __do_global_ctors_aux and
__do_global_dtors_aux span through the whole text segment. These are
direct calls ranging +/-32M and unnecessarily limiting the size of the
text segment.
Regression-tested on powerpc-lynx-lynxos. There is a new regression
(gcc.dg/20010912-1.c) but it is an -fpic testcase and on LynxOS only
-fPIC works due to a kernel bug.
OK to commit?
2005-07-06 Adam Nemet <anemet@lnxw.com>
* config/rs6000/lynx.h: Mark __do_global_ctors_aux and
__do_global_dtors_aux longcall.
Index: lynx.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/lynx.h,v
retrieving revision 1.21
diff -u -p -r1.21 lynx.h
--- lynx.h 25 Jun 2005 01:22:07 -0000 1.21
+++ lynx.h 7 Jul 2005 01:33:45 -0000
@@ -106,3 +106,20 @@
#undef HAVE_AS_TLS
#define HAVE_AS_TLS 0
+
+#ifdef CRT_BEGIN
+/* This function is part of crtbegin*.o which is at the beginning of
+ the link and is called from .fini which is usually toward the end
+ of the executable. Make it longcall so that we don't limit the
+ text size of the executables to 32M. */
+
+static void __do_global_dtors_aux (void) __attribute__ ((longcall));
+#endif /* CRT_BEGIN */
+
+#ifdef CRT_END
+/* Similarly here. This function resides in crtend*.o which is toward
+ to end of the link and is called from .init which is at the
+ beginning. */
+
+static void __do_global_ctors_aux (void) __attribute__ ((longcall));
+#endif /* CRT_END */