Skip to contentSkip to conversation

arm, m68k: fix out-of-range jump

RFC PATCH New Heiko Schocher 2 participants 4 messages Apr 15, 2016 – Apr 18, 2016 m68k architecture

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 arm, m68k: fix out-of-range jump

fix the following build error for m68k boards:
Building current source for 48 boards (2 threads, 1 job per thread)

      m68k:  +   M54455EVB_i66

+arch/m68k/cpu/mcf5445x/start.o: In function `_start':
+arch/m68k/cpu/mcf5445x/start.S:668:(.text+0x45a): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o +make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

---
This commit fixes build error:
https://travis-ci.org/hsdenx/u-boot/jobs/123254183

fixed log see:
https://travis-ci.org/hsdenx/u-boot/jobs/123281032

Any ideas why the changes did not work for:
arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf532x/start.S

but work for
arch/m68k/cpu/mcf5445x/start.S

I have no real m68k experiences, so help is appreciated!

 arch/m68k/cpu/mcf523x/start.S  | 4 ++--
 arch/m68k/cpu/mcf52x2/start.S  | 4 ++--
 arch/m68k/cpu/mcf532x/start.S  | 4 ++--
 arch/m68k/cpu/mcf5445x/start.S | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/cpu/mcf523x/start.S +2 -2
index 8a23e72..ad7bde4 100644
@@ -141,8 +141,8 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
 	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf52x2/start.S +2 -2
index 8a59496..a16b589 100644
@@ -198,8 +198,8 @@ _after_flashbar_copy:
 
 	move.l #__got_start, %a5		/* put relocation table address to a5 */
 
-	bsr cpu_init_f				/* run low-level CPU init code (from flash) */
-	bsr board_init_f			/* run low-level board init code (from flash) */
+	jbsr cpu_init_f				/* run low-level CPU init code (from flash) */
+	jbsr board_init_f			/* run low-level board init code (from flash) */
 
 	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf532x/start.S +2 -2
index 3b9ede0..50d301c 100644
@@ -155,8 +155,8 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
 	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf5445x/start.S +2 -2
index ae261b1..ff8d627 100644
@@ -664,8 +664,8 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
 	/* board_init_f() does not return */
 
Signature · 1 line
2.5.0
#1 lore raw

RFC PATCH 1/1 arm, m68k: fix out-of-range jump

Hi Heiko,

Quoted 84 lines · Heiko Schocher

fix the following build error for m68k boards:
Building current source for 48 boards (2 threads, 1 job per thread)

       m68k:  +   M54455EVB_i66
(quoted diff) +4 -0
+arch/m68k/cpu/mcf5445x/start.o: In function `_start':
+arch/m68k/cpu/mcf5445x/start.S:668:(.text+0x45a): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

---
This commit fixes build error:
https://travis-ci.org/hsdenx/u-boot/jobs/123254183

fixed log see:
https://travis-ci.org/hsdenx/u-boot/jobs/123281032

Any ideas why the changes did not work for:
arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf532x/start.S

but work for
arch/m68k/cpu/mcf5445x/start.S

I have no real m68k experiences, so help is appreciated!

  arch/m68k/cpu/mcf523x/start.S  | 4 ++--
  arch/m68k/cpu/mcf52x2/start.S  | 4 ++--
  arch/m68k/cpu/mcf532x/start.S  | 4 ++--
  arch/m68k/cpu/mcf5445x/start.S | 4 ++--
  4 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/cpu/mcf523x/start.S +2 -2
index 8a23e72..ad7bde4 100644
@@ -141,8 +141,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf52x2/start.S +2 -2
index 8a59496..a16b589 100644
@@ -198,8 +198,8 @@ _after_flashbar_copy:
 
  	move.l #__got_start, %a5		/* put relocation table address to a5 */
 
-	bsr cpu_init_f				/* run low-level CPU init code (from flash) */
-	bsr board_init_f			/* run low-level board init code (from flash) */
+	jbsr cpu_init_f				/* run low-level CPU init code (from flash) */
+	jbsr board_init_f			/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf532x/start.S +2 -2
index 3b9ede0..50d301c 100644
@@ -155,8 +155,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf5445x/start.S +0 -0
index ae261b1..ff8d627 100644

arch/m68k/cpu/mcf5445x/start.S _start: · line 671

Quoted 10 lines
arch/m68k/cpu/mcf5445x/start.S +2 -2
@@ -664,8 +664,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 

I just sent a very similar patch some days ago.

https://patchwork.ozlabs.org/patch/609150/

Issue should be fixed.

Regards,
Angelo

#2 lore raw

RFC PATCH 1/1 arm, m68k: fix out-of-range jump

Hello Angelo,

Am 15.04.2016 um 16:39 schrieb Angelo Dureghello:

Quoted 101 lines

Hi Heiko,

Quoted 85 lines · Heiko Schocher

fix the following build error for m68k boards:
Building current source for 48 boards (2 threads, 1 job per thread)

       m68k:  +   M54455EVB_i66
(quoted diff) +2 -0
+arch/m68k/cpu/mcf5445x/start.o: In function `_start':
+arch/m68k/cpu/mcf5445x/start.S:668:(.text+0x45a): relocation truncated to fit: R_68K_PC16 against

symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o

(quoted diff) +2 -0
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

---
This commit fixes build error:
https://travis-ci.org/hsdenx/u-boot/jobs/123254183

fixed log see:
https://travis-ci.org/hsdenx/u-boot/jobs/123281032

Any ideas why the changes did not work for:
arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf532x/start.S

but work for
arch/m68k/cpu/mcf5445x/start.S

I have no real m68k experiences, so help is appreciated!

  arch/m68k/cpu/mcf523x/start.S  | 4 ++--
  arch/m68k/cpu/mcf52x2/start.S  | 4 ++--
  arch/m68k/cpu/mcf532x/start.S  | 4 ++--
  arch/m68k/cpu/mcf5445x/start.S | 4 ++--
  4 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/cpu/mcf523x/start.S +2 -2
index 8a23e72..ad7bde4 100644
@@ -141,8 +141,8 @@ _start:
 
      move.l #__got_start, %a5    /* put relocation table address to a5 */
 
-    bsr cpu_init_f            /* run low-level CPU init code (from flash) */
-    bsr board_init_f        /* run low-level board init code (from flash) */
+    jbsr cpu_init_f            /* run low-level CPU init code (from flash) */
+    jbsr board_init_f        /* run low-level board init code (from flash) */
 
      /* board_init_f() does not return */
 
arch/m68k/cpu/mcf52x2/start.S +2 -2
index 8a59496..a16b589 100644
@@ -198,8 +198,8 @@ _after_flashbar_copy:
 
      move.l #__got_start, %a5        /* put relocation table address to a5 */
 
-    bsr cpu_init_f                /* run low-level CPU init code (from flash) */
-    bsr board_init_f            /* run low-level board init code (from flash) */
+    jbsr cpu_init_f                /* run low-level CPU init code (from flash) */
+    jbsr board_init_f            /* run low-level board init code (from flash) */
 
      /* board_init_f() does not return */
 
arch/m68k/cpu/mcf532x/start.S +2 -2
index 3b9ede0..50d301c 100644
@@ -155,8 +155,8 @@ _start:
 
      move.l #__got_start, %a5    /* put relocation table address to a5 */
 
-    bsr cpu_init_f            /* run low-level CPU init code (from flash) */
-    bsr board_init_f        /* run low-level board init code (from flash) */
+    jbsr cpu_init_f            /* run low-level CPU init code (from flash) */
+    jbsr board_init_f        /* run low-level board init code (from flash) */
 
      /* board_init_f() does not return */
 
arch/m68k/cpu/mcf5445x/start.S +0 -0
index ae261b1..ff8d627 100644

arch/m68k/cpu/mcf5445x/start.S _start: · line 671

Quoted 10 lines
arch/m68k/cpu/mcf5445x/start.S +2 -2
@@ -664,8 +664,8 @@ _start:
 
      move.l #__got_start, %a5    /* put relocation table address to a5 */
 
-    bsr cpu_init_f            /* run low-level CPU init code (from flash) */
-    bsr board_init_f        /* run low-level board init code (from flash) */
+    jbsr cpu_init_f            /* run low-level CPU init code (from flash) */
+    jbsr board_init_f        /* run low-level board init code (from flash) */
 
      /* board_init_f() does not return */
 

I just sent a very similar patch some days ago.

Quoted 3 lines

https://patchwork.ozlabs.org/patch/609150/

Issue should be fixed.

Oh, sorry for overlooking this!

Thanks for fixing!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

RFC PATCH 1/1 arm, m68k: fix out-of-range jump

In reply to Heiko Schocher

Hi Heiko,

Quoted 21 lines · Heiko Schocher

fix the following build error for m68k boards:
Building current source for 48 boards (2 threads, 1 job per thread)

       m68k:  +   M54455EVB_i66
(quoted diff) +4 -0
+arch/m68k/cpu/mcf5445x/start.o: In function `_start':
+arch/m68k/cpu/mcf5445x/start.S:668:(.text+0x45a): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

---
This commit fixes build error:
https://travis-ci.org/hsdenx/u-boot/jobs/123254183

fixed log see:
https://travis-ci.org/hsdenx/u-boot/jobs/123281032

Any ideas why the changes did not work for:
arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf532x/start.S

Quoted 4 lines

but work for
arch/m68k/cpu/mcf5445x/start.S

I have no real m68k experiences, so help is appreciated!

sorry, i realized later you was asking the reason why jbsr is not working with

Quoted 3 lines

arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf532x/start.S

jbsr is an alias for bsr.l that is supported only from ISA_B. In ISA_A it is likely translated to 16bit relative jump.

I prepared some notes, you can check ISA Revisions here:
http://www.denx.de/wiki/U-Boot/ColdFireNotes

Best regards,
Angelo Dureghello

Quoted 69 lines

  arch/m68k/cpu/mcf523x/start.S  | 4 ++--
  arch/m68k/cpu/mcf52x2/start.S  | 4 ++--
  arch/m68k/cpu/mcf532x/start.S  | 4 ++--
  arch/m68k/cpu/mcf5445x/start.S | 4 ++--
  4 files changed, 8 insertions(+), 8 deletions(-)
arch/m68k/cpu/mcf523x/start.S +2 -2
index 8a23e72..ad7bde4 100644
@@ -141,8 +141,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf52x2/start.S +2 -2
index 8a59496..a16b589 100644
@@ -198,8 +198,8 @@ _after_flashbar_copy:
 
  	move.l #__got_start, %a5		/* put relocation table address to a5 */
 
-	bsr cpu_init_f				/* run low-level CPU init code (from flash) */
-	bsr board_init_f			/* run low-level board init code (from flash) */
+	jbsr cpu_init_f				/* run low-level CPU init code (from flash) */
+	jbsr board_init_f			/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf532x/start.S +2 -2
index 3b9ede0..50d301c 100644
@@ -155,8 +155,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */
 
arch/m68k/cpu/mcf5445x/start.S +2 -2
index ae261b1..ff8d627 100644
@@ -664,8 +664,8 @@ _start:
 
  	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
-	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
-	bsr board_init_f		/* run low-level board init code (from flash) */
+	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
+	jbsr board_init_f		/* run low-level board init code (from flash) */
 
  	/* board_init_f() does not return */