ldivmod, uldivmod: fix qdivrem calls
. ldivmod, uldivmod were passing the modulo argument pointer in R4, which is bogus, as qdivrem expects it on the stack as per the EABI, causing essentially 'random' memory to be trampled by qdivrem. fix by pushing R4 before the call. . also add these functions to -minc so -lminc clients can be linked without -lgcc Change-Id: I90b0b28b51a188c93da5de6afb108224749ea794
This commit is contained in:
		
							parent
							
								
									46e7c7a920
								
							
						
					
					
						commit
						f5cfab17d6
					
				@ -66,7 +66,9 @@ ENTRY(__aeabi_ldivmod)
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	sub	sp, sp, #8
 | 
						sub	sp, sp, #8
 | 
				
			||||||
	mov	r4, sp		/* pointer to remainder */
 | 
						mov	r4, sp		/* pointer to remainder */
 | 
				
			||||||
 | 
						push	{r4}
 | 
				
			||||||
	bl	PLT_SYM(__qdivrem)
 | 
						bl	PLT_SYM(__qdivrem)
 | 
				
			||||||
 | 
						add	sp, sp, #4	/* forget pointer to remainder */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	teq	NEG, #0		/* any signs to flip? */
 | 
						teq	NEG, #0		/* any signs to flip? */
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
 | 
				
			|||||||
@ -41,7 +41,9 @@ ENTRY(__aeabi_uldivmod)
 | 
				
			|||||||
	push	{r4,lr}
 | 
						push	{r4,lr}
 | 
				
			||||||
	sub	sp, sp, #8
 | 
						sub	sp, sp, #8
 | 
				
			||||||
	mov	r4, sp
 | 
						mov	r4, sp
 | 
				
			||||||
 | 
						push	{r4}
 | 
				
			||||||
	bl	PLT_SYM(__qdivrem)
 | 
						bl	PLT_SYM(__qdivrem)
 | 
				
			||||||
 | 
						add	sp, sp, #4
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * The remainder is already on the stack just waiting to be popped
 | 
						 * The remainder is already on the stack just waiting to be popped
 | 
				
			||||||
	 * into r2/r3.
 | 
						 * into r2/r3.
 | 
				
			||||||
 | 
				
			|||||||
@ -131,6 +131,10 @@ CPPFLAGS.strtol.c+=     -I${LIBCSRCDIR}/../../common/lib/libc/stdlib
 | 
				
			|||||||
SRCS+= ${i}
 | 
					SRCS+= ${i}
 | 
				
			||||||
.endfor
 | 
					.endfor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.if (${MACHINE_ARCH} == "earm")
 | 
				
			||||||
 | 
					SRCS += __aeabi_ldivmod.S __aeabi_uldivmod.S
 | 
				
			||||||
 | 
					.endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Import from locale
 | 
					# Import from locale
 | 
				
			||||||
.for i in _def_time.c
 | 
					.for i in _def_time.c
 | 
				
			||||||
.PATH.c: ${LIBCSRCDIR}/locale
 | 
					.PATH.c: ${LIBCSRCDIR}/locale
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user