This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tuesday 02 June 2009, Paul Brook wrote:This would require changing the initialization macro in kind or else there will be trouble. I'm not thrilled with leaving two gaps in the struct for 16-bit platforms, but there are now 2 unused fields since Corinna revamped locale support. If the unpaired int that is caused by the errno move was put below and the unused fields were removed, I could certainly live with that as the struct gets smaller and there is one left-over int anyway. Might as well be errno.
In my sources this field lives at the same location in both cases.Yes, this leaks out into user code -- at least it does for me. Try building the standard arm-eabi multilib tools and then running the gcc testsuite with -mcpu=cortex-a8 and -mthumb. Programs such as gcc.c-torture/exectute/fprintf-1.c will then fail.
The definition of stdout is:
#define stdout (_REENT->_stdout)
Further investigation indicates upstream newlib is missing the following patch.
2009-06-02 Paul Brook <paul@codesourcery.com>
newlib/ * libc/include/sys/reent.h (_reent): Adjust _REENT_SMALL to be binary compatible with normal layout
Index: newlib/libc/include/sys/reent.h
===================================================================
--- newlib/libc/include/sys/reent.h (revision 159552)
+++ newlib/libc/include/sys/reent.h (revision 159553)
@@ -344,14 +344,15 @@ struct _misc_reent
* ports with 16-bit int's but 32-bit pointers, align nicely. */
struct _reent
{
+ /* As an exception to the above put _errno first for binary
+ compatibility with non _REENT_SMALL targets. */
+ int _errno; /* local copy of errno */
/* FILE is a big struct and may change over time. To try to achieve binary
compatibility with future versions, put stdin,stdout,stderr here.
These are pointers into member __sf defined below. */
__FILE *_stdin, *_stdout, *_stderr; /* XXX */
- int _errno; /* local copy of errno */
-
int _inc; /* used by tmpnam */
char *_emergency;
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |