This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Force _impure_ptr in .sdata section for MIPS
- From: Thiemo Seufer <ths at networkno dot de>
- To: newlib at sources dot redhat dot com
- Date: Tue, 1 Aug 2006 11:56:14 +0100
- Subject: [PATCH] Force _impure_ptr in .sdata section for MIPS
Hello All,
the appended patch places impure pointers in the .sdata section
for MIPS, this allows reliable builds with GP optimisation.
(Currently a build fails when the distance of such a pointer
reference exceeds the 16bit immediate.)
Thiemo
2006-08-01 Thiemo Seufer <ths@mips.com>
Nigel Stephens <nigel@mips.com>
* libc/include/sys/config.h (__ATTRIBUTE_IMPURE_PTR__): For MIPS
define this to force _impure_ptr to live in the .sdata section.
Index: newlib/libc/include/sys/config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.42
diff -u -p -r1.42 config.h
--- newlib/libc/include/sys/config.h 31 Jan 2006 19:33:56 -0000 1.42
+++ newlib/libc/include/sys/config.h 31 Jul 2006 14:10:52 -0000
@@ -94,6 +94,10 @@
#endif
#endif
+#ifdef __mips__
+#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
+#endif
+
#ifdef __xstormy16__
#define __SMALL_BITFIELDS
#undef INT_MAX