This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

eabi.asm question


I have a question about the function __eabi in
gcc/config/rs6000/eabi.asm. Here is the relevant code:

FUNC_START(__eabi)

< stuff deleted >

#else /* -mrelocatable */
	mflr	0
	bl	.Laddr				/* get current address
*/
.Laddr:
	mflr	12				/* real address of
.Laddr */
	lwz	11,(.Lptr-.Laddr)(12)		/* linker generated
address of .LCTOC1 */
	add	11,11,12			/* correct to real
pointer */
	lwz	12,.Ltable(11)			/* get linker's idea of
where .Laddr is */
	lwz	10,.Linit(11)			/* address of init flag
*/
	subf.	12,12,11			/* calculate difference
*/
	lwzx	9,10,12				/* done flag */
	cmplwi	2,9,0				/* init flag != 0? */
	bnelr	2				/* return now, if we've
been called already */

Here, LR still holds the address of .Laddr, instead of the return
address. Doesn't LR need to be
restored from R0 before this instruction? 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]