#else /* __PIC__ */
- /* Common for -mid-shared-libary and -msep-data */
+ /* Common for Linux and uClinux, the latter with either
+ -mid-shared-library or -msep-data. */
.macro PICCALL addr
-#if defined (__mcoldfire__) && !defined (__mcfisab__)
+#if defined (__mcoldfire__) && !defined (__mcfisab__) && !defined (__mcfisac__)
lea \addr-.-8,a0
jsr pc@(a0)
#else
.endm
.macro PICJUMP addr
+ /* ISA C has no bra.l instruction, and since this assembly file
+ gets assembled into multiple object files, we avoid the
+ bra instruction entirely. */
#if defined (__mcoldfire__) && !defined (__mcfisab__)
lea \addr-.-8,a0
jmp pc@(a0)
#endif
.endm
-# if defined(__ID_SHARED_LIBRARY__)
+# if defined (__uClinux__)
+
+ /* Versions for uClinux */
+
+# if defined(__ID_SHARED_LIBRARY__)
/* -mid-shared-library versions */
movel \sym@GOT(\areg), sp@-
.endm
-# else /* !__ID_SHARED_LIBRARY__ */
+# else /* !__ID_SHARED_LIBRARY__ */
/* Versions for -msep-data */
movel \sym@GOT(a5), sp@-
.endm
-# endif /* !__ID_SHARED_LIBRARY__ */
+# endif
+
+# else /* !__uClinux__ */
+
+ /* Versions for Linux */
+
+ .macro PICLEA sym, reg
+ movel #_GLOBAL_OFFSET_TABLE_@GOTPC, \reg
+ lea (-6, pc, \reg), \reg
+ movel \sym@GOT(\reg), \reg
+ .endm
+
+ .macro PICPEA sym, areg
+ movel #_GLOBAL_OFFSET_TABLE_@GOTPC, \areg
+ lea (-6, pc, \areg), \areg
+ movel \sym@GOT(\areg), sp@-
+ .endm
+
+# endif
#endif /* __PIC__ */