Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4260415f authored by Russell King's avatar Russell King
Browse files

ARM: fix build error in arch/arm/kernel/process.c



/tmp/ccJ3ssZW.s: Assembler messages:
/tmp/ccJ3ssZW.s:1952: Error: can't resolve `.text' {.text section} - `.LFB1077'

This is caused because:

	.section .data
	.section .text
	.section .text
	.previous

does not return us to the .text section, but the .data section; this
makes use of .previous dangerous if the ordering of previous sections
is not known.

Fix up the other users of .previous; .pushsection and .popsection are
a safer pairing to use than .section and .previous.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 05ce7bfe
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -149,10 +149,10 @@

#define USER(x...)				\
9999:	x;					\
	.section __ex_table,"a";		\
	.pushsection __ex_table,"a";		\
	.align	3;				\
	.long	9999b,9001f;			\
	.previous
	.popsection

/*
 * SMP data memory barrier
@@ -193,10 +193,10 @@
	.error	"Unsupported inc macro argument"
	.endif

	.section __ex_table,"a"
	.pushsection __ex_table,"a"
	.align	3
	.long	9999b, \abort
	.previous
	.popsection
	.endm

	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
@@ -234,10 +234,10 @@
	.error	"Unsupported inc macro argument"
	.endif

	.section __ex_table,"a"
	.pushsection __ex_table,"a"
	.align	3
	.long	9999b, \abort
	.previous
	.popsection
	.endr
	.endm

+8 −8
Original line number Diff line number Diff line
@@ -21,14 +21,14 @@
	"2:	strt	%0, [%2]\n"				\
	"	mov	%0, #0\n"				\
	"3:\n"							\
	"	.section __ex_table,\"a\"\n"			\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 4f, 2b, 4f\n"			\
	"	.previous\n"					\
	"	.section .fixup,\"ax\"\n"			\
	"	.popsection\n"					\
	"	.pushsection .fixup,\"ax\"\n"			\
	"4:	mov	%0, %4\n"				\
	"	b	3b\n"					\
	"	.previous"					\
	"	.popsection"					\
	: "=&r" (ret), "=&r" (oldval)				\
	: "r" (uaddr), "r" (oparg), "Ir" (-EFAULT)		\
	: "cc", "memory")
@@ -102,14 +102,14 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
	"	it	eq	@ explicit IT needed for the 2b label\n"
	"2:	streqt	%2, [%3]\n"
	"3:\n"
	"	.section __ex_table,\"a\"\n"
	"	.pushsection __ex_table,\"a\"\n"
	"	.align	3\n"
	"	.long	1b, 4f, 2b, 4f\n"
	"	.previous\n"
	"	.section .fixup,\"ax\"\n"
	"	.popsection\n"
	"	.pushsection .fixup,\"ax\"\n"
	"4:	mov	%0, %4\n"
	"	b	3b\n"
	"	.previous"
	"	.popsection"
	: "=&r" (val)
	: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
	: "cc", "memory");
+20 −20
Original line number Diff line number Diff line
@@ -229,16 +229,16 @@ do { \
	__asm__ __volatile__(					\
	"1:	ldrbt	%1,[%2]\n"				\
	"2:\n"							\
	"	.section .fixup,\"ax\"\n"			\
	"	.pushsection .fixup,\"ax\"\n"			\
	"	.align	2\n"					\
	"3:	mov	%0, %3\n"				\
	"	mov	%1, #0\n"				\
	"	b	2b\n"					\
	"	.previous\n"					\
	"	.section __ex_table,\"a\"\n"			\
	"	.popsection\n"					\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 3b\n"				\
	"	.previous"					\
	"	.popsection"					\
	: "+r" (err), "=&r" (x)					\
	: "r" (addr), "i" (-EFAULT)				\
	: "cc")
@@ -265,16 +265,16 @@ do { \
	__asm__ __volatile__(					\
	"1:	ldrt	%1,[%2]\n"				\
	"2:\n"							\
	"	.section .fixup,\"ax\"\n"			\
	"	.pushsection .fixup,\"ax\"\n"			\
	"	.align	2\n"					\
	"3:	mov	%0, %3\n"				\
	"	mov	%1, #0\n"				\
	"	b	2b\n"					\
	"	.previous\n"					\
	"	.section __ex_table,\"a\"\n"			\
	"	.popsection\n"					\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 3b\n"				\
	"	.previous"					\
	"	.popsection"					\
	: "+r" (err), "=&r" (x)					\
	: "r" (addr), "i" (-EFAULT)				\
	: "cc")
@@ -310,15 +310,15 @@ do { \
	__asm__ __volatile__(					\
	"1:	strbt	%1,[%2]\n"				\
	"2:\n"							\
	"	.section .fixup,\"ax\"\n"			\
	"	.pushsection .fixup,\"ax\"\n"			\
	"	.align	2\n"					\
	"3:	mov	%0, %3\n"				\
	"	b	2b\n"					\
	"	.previous\n"					\
	"	.section __ex_table,\"a\"\n"			\
	"	.popsection\n"					\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 3b\n"				\
	"	.previous"					\
	"	.popsection"					\
	: "+r" (err)						\
	: "r" (x), "r" (__pu_addr), "i" (-EFAULT)		\
	: "cc")
@@ -343,15 +343,15 @@ do { \
	__asm__ __volatile__(					\
	"1:	strt	%1,[%2]\n"				\
	"2:\n"							\
	"	.section .fixup,\"ax\"\n"			\
	"	.pushsection .fixup,\"ax\"\n"			\
	"	.align	2\n"					\
	"3:	mov	%0, %3\n"				\
	"	b	2b\n"					\
	"	.previous\n"					\
	"	.section __ex_table,\"a\"\n"			\
	"	.popsection\n"					\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 3b\n"				\
	"	.previous"					\
	"	.popsection"					\
	: "+r" (err)						\
	: "r" (x), "r" (__pu_addr), "i" (-EFAULT)		\
	: "cc")
@@ -371,16 +371,16 @@ do { \
 THUMB(	"1:	strt	" __reg_oper1 ", [%1]\n"	)	\
 THUMB(	"2:	strt	" __reg_oper0 ", [%1, #4]\n"	)	\
	"3:\n"							\
	"	.section .fixup,\"ax\"\n"			\
	"	.pushsection .fixup,\"ax\"\n"			\
	"	.align	2\n"					\
	"4:	mov	%0, %3\n"				\
	"	b	3b\n"					\
	"	.previous\n"					\
	"	.section __ex_table,\"a\"\n"			\
	"	.popsection\n"					\
	"	.pushsection __ex_table,\"a\"\n"		\
	"	.align	3\n"					\
	"	.long	1b, 4b\n"				\
	"	.long	2b, 4b\n"				\
	"	.previous"					\
	"	.popsection"					\
	: "+r" (err), "+r" (__pu_addr)				\
	: "r" (x), "i" (-EFAULT)				\
	: "cc")
+5 −5
Original line number Diff line number Diff line
@@ -523,16 +523,16 @@ ENDPROC(__und_usr)
/*
 * The out of line fixup for the ldrt above.
 */
	.section .fixup, "ax"
	.pushsection .fixup, "ax"
4:	mov	pc, r9
	.previous
	.section __ex_table,"a"
	.popsection
	.pushsection __ex_table,"a"
	.long	1b, 4b
#if __LINUX_ARM_ARCH__ >= 7
	.long	2b, 4b
	.long	3b, 4b
#endif
	.previous
	.popsection

/*
 * Check whether the instruction is a co-processor instruction.
@@ -679,7 +679,7 @@ do_fpe:
	.data
ENTRY(fp_enter)
	.word	no_fp
	.previous
	.text

ENTRY(no_fp)
	mov	pc, lr
+4 −4
Original line number Diff line number Diff line
@@ -62,15 +62,15 @@ int ftrace_modify_code(unsigned long pc, unsigned char *old_code,
		"    movne  %0, #2    \n"
		"3:\n"

		".section .fixup, \"ax\"\n"
		".pushsection .fixup, \"ax\"\n"
		"4:  mov  %0, #1  \n"
		"    b    3b      \n"
		".previous\n"
		".popsection\n"

		".section __ex_table, \"a\"\n"
		".pushsection __ex_table, \"a\"\n"
		"    .long 1b, 4b \n"
		"    .long 2b, 4b \n"
		".previous\n"
		".popsection\n"

		: "=r"(err), "=r"(replaced)
		: "r"(pc), "r"(new), "r"(old), "0"(err), "1"(replaced)
Loading