[mips libgloss patch] fix types of a couple of vars in cfe.c

cgd@broadcom.com cgd@broadcom.com
Sun Feb 16 07:02:00 GMT 2003

comments explain it.  tested for long enough in my private source tree
(sb1-elf target) that i'd forgotten it was there.  8-)

2003-02-15  Chris Demetriou  <cgd@broadcom.com>

	* mips/cfe.c (__cfe_handle, __cfe_entrypt): Fix types.

Index: mips/cfe.c
RCS file: /cvs/src/src/libgloss/mips/cfe.c,v
retrieving revision 1.2
diff -u -p -r1.2 cfe.c
--- mips/cfe.c	5 Feb 2003 17:01:33 -0000	1.2
+++ mips/cfe.c	16 Feb 2003 07:00:18 -0000
@@ -48,9 +48,14 @@ static void *force_prestart = &_prestart
    either you compile specially (with -fno-zero-initialized-in-bss), or
    you init to non-zero.  In this case, initting to non-zero is OK (and
    even beneficial; alignment fault via jump to odd if not properly
-   set up by _prestart()), so we do the latter.  */
-unsigned int __cfe_handle = 0xdeadbeef;
-unsigned int __cfe_entrypt = 0xdeadbeef;
+   set up by _prestart()), so we do the latter.
+   These variables are 'int's so they can be reliably stored w/ "sw".
+   (longs fall victim to -mlong64.)  They are signed so that they remain
+   valid pointers when extended to cfe_xuint_t in the call to cfe_init().
+   This assumes that they are compatibility-space pointers.  */
+int __cfe_handle = 0xdeadbeef;
+int __cfe_entrypt = 0xdeadbeef;
 /* Echo input characters?  */
 int	__cfe_echo_input = 0;

More information about the Newlib mailing list