Linux Thumb-2 libgcc fix.

Paul Brook paul@codesourcery.com
Sun Mar 25 06:54:00 GMT 2007


The patch below allows building libgcc in Thumb mode on arm-linux-gnueabi.

The first change uses the normal arm/unified assembler macros in the div0 
functions.

The second change removes some hacks to support EABI binaries on legacy 
kernels. This was never supported in FSF releases.

Paul

2007-03-24  Paul Brook  <paul@codesourcery.com>

	* config/arm/lib1funcs.asm (div0): Use ARM_FUNC_START and do_push.
	* config/arm/linux-eabi.h: Remove legacy syscall hack.

Index: gcc/config/arm/lib1funcs.asm
===================================================================
--- gcc/config/arm/lib1funcs.asm	(revision 166691)
+++ gcc/config/arm/lib1funcs.asm	(working copy)
@@ -1069,10 +1069,9 @@ LSYM(Lover12):
 /* Constant taken from <asm/signal.h>.  */
 #define SIGFPE	8
 
-	.code	32
-	FUNC_START div0
+	ARM_FUNC_START div0
 
-	stmfd	sp!, {r1, lr}
+	do_push	{r1, lr}
 	mov	r0, #SIGFPE
 	bl	SYM(raise) __PLT__
 	RETLDM	r1
Index: gcc/config/arm/linux-eabi.h
===================================================================
--- gcc/config/arm/linux-eabi.h	(revision 166691)
+++ gcc/config/arm/linux-eabi.h	(working copy)
@@ -65,8 +65,7 @@
 #undef LIBGCC_SPEC
 
 /* Clear the instruction cache from `beg' to `end'.  This makes an
-   inline system call to SYS_cacheflush.  It is modified to work with
-   both the original and EABI-only syscall interfaces.  */
+   inline system call to SYS_cacheflush.  */
 #undef CLEAR_INSN_CACHE
 #define CLEAR_INSN_CACHE(BEG, END)					\
 {									\
@@ -74,7 +73,7 @@
   register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
   register unsigned long _flg __asm ("a3") = 0;				\
   register unsigned long _scno __asm ("r7") = 0xf0002;			\
-  __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\
+  __asm __volatile ("swi 0		@ sys_cacheflush"		\
 		    : "=r" (_beg)					\
 		    : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno));	\
 }



More information about the Gcc-patches mailing list