[PATCH 2/3] MIPS: pbl: use generated label in ADR macro

Antony Pavlov antonynpavlov at gmail.com
Mon Jun 17 12:35:19 EDT 2013


The generated label usage make possible
to use the ADR macro many times.

If we don't use a generated label and we try
to use the ADR macro second time then we get

   Error: symbol `_pc' is already defined

Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 arch/mips/include/asm/pbl_macros.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/pbl_macros.h b/arch/mips/include/asm/pbl_macros.h
index 6a48ca4..3971b61 100644
--- a/arch/mips/include/asm/pbl_macros.h
+++ b/arch/mips/include/asm/pbl_macros.h
@@ -41,9 +41,9 @@
 	.set	push
 	.set	noreorder
 	move	\temp, ra			# preserve ra beforehand
-	bal	_pc
+	bal	255f
 	 nop
-_pc:	addiu	\rd, ra, \label - _pc		# label is assumed to be
+255:	addiu	\rd, ra, \label - 255b		# label is assumed to be
 	move	ra, \temp			# within pc +/- 32KB
 	.set	pop
 	.endm
-- 
1.7.10.4




More information about the barebox mailing list