Patch to fix register reuse in mips/crt0.S

Richard Sandiford rsandifo@redhat.com
Thu Feb 6 12:25:00 GMT 2003


mips crt0.S calls get_mem_info with a0 set to __memsize, then reuses
this (potentially call-clobbered) value of a0 after the call.

Tested on mips64vr-elf, OK to install?

Richard


	* mips/crt0.S (zerobss): Reload __memsize after call.

Index: mips/crt0.S
===================================================================
RCS file: /cvs/src/src/libgloss/mips/crt0.S,v
retrieving revision 1.7
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.7 crt0.S
--- mips/crt0.S	8 Jan 2003 12:54:29 -0000	1.7
+++ mips/crt0.S	6 Feb 2003 12:11:23 -0000
@@ -154,6 +154,7 @@ 3:
 
 	/* NOTE: a0[0] contains the amount of memory available, and
 	         not the last memory address. */
+	la	a0, __memsize
 	lw	t0,0(a0)			# last address of memory available
 	la	t1,K0BASE			# cached kernel memory
 	addu	t0,t0,t1			# get the end of memory address



More information about the Newlib mailing list