Commit 8d29b7b9f81d6b83d869ff054e6c189d6da73f1f
Committed by
Haavard Skinnemoen
1 parent
7cb36b6ccd
Exists in
master
and in
7 other branches
avr32: Fix out-of-range rcalls in large kernels
Replace handcoded rcall instructions with the call pseudo-instruction. For kernels too far over 1MB the rcall instruction can't reach and linking will fail. We already call the final linker with --relax which converts call pseudo-instructions to the right things anyway. This fixes arch/avr32/kernel/built-in.o: In function `syscall_exit_work': (.ex.text+0x198): relocation truncated to fit: R_AVR32_22H_PCREL against symbol `schedule' defined in .sched.text section in kernel/built-in.o arch/avr32/kernel/built-in.o: In function `fault_exit_work': (.ex.text+0x3b6): relocation truncated to fit: R_AVR32_22H_PCREL against symbol `schedule' defined in .sched.text section in kernel/built-in.o But I'm still left with arch/avr32/kernel/built-in.o:(.fixup+0x2): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+45a arch/avr32/kernel/built-in.o:(.fixup+0x8): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+8ea arch/avr32/kernel/built-in.o:(.fixup+0xe): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+abe arch/avr32/kernel/built-in.o:(.fixup+0x14): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+ac8 arch/avr32/kernel/built-in.o:(.fixup+0x1a): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+ad2 arch/avr32/kernel/built-in.o:(.fixup+0x20): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+adc arch/avr32/kernel/built-in.o:(.fixup+0x26): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+ae6 arch/avr32/kernel/built-in.o:(.fixup+0x2c): relocation truncated to fit: R_AVR32_22H_PCREL against `.text'+af0 arch/avr32/kernel/built-in.o:(.fixup+0x32): additional relocation overflows omitted from the output These are caused by a similar problem with 'rjmp' instructions. Unfortunately, there's no easy fix for these at the moment since we don't have a arbitrary-range 'jmp' instruction similar to 'call'. Signed-off-by: Ben Nizette <bn@niasdigital.com> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Showing 3 changed files with 38 additions and 38 deletions Side-by-side Diff
arch/avr32/kernel/entry-avr32b.S
... | ... | @@ -150,10 +150,10 @@ |
150 | 150 | tlbmiss_restore |
151 | 151 | sub sp, 4 |
152 | 152 | stmts --sp, r0-lr |
153 | - rcall save_full_context_ex | |
153 | + call save_full_context_ex | |
154 | 154 | mfsr r12, SYSREG_ECR |
155 | 155 | mov r11, sp |
156 | - rcall do_page_fault | |
156 | + call do_page_fault | |
157 | 157 | rjmp ret_from_exception |
158 | 158 | |
159 | 159 | .align 2 |
... | ... | @@ -250,7 +250,7 @@ |
250 | 250 | |
251 | 251 | .global ret_from_fork |
252 | 252 | ret_from_fork: |
253 | - rcall schedule_tail | |
253 | + call schedule_tail | |
254 | 254 | |
255 | 255 | /* check for syscall tracing */ |
256 | 256 | get_thread_info r0 |
... | ... | @@ -261,7 +261,7 @@ |
261 | 261 | |
262 | 262 | syscall_trace_enter: |
263 | 263 | pushm r8-r12 |
264 | - rcall syscall_trace | |
264 | + call syscall_trace | |
265 | 265 | popm r8-r12 |
266 | 266 | rjmp syscall_trace_cont |
267 | 267 | |
268 | 268 | |
... | ... | @@ -269,14 +269,14 @@ |
269 | 269 | bld r1, TIF_SYSCALL_TRACE |
270 | 270 | brcc 1f |
271 | 271 | unmask_interrupts |
272 | - rcall syscall_trace | |
272 | + call syscall_trace | |
273 | 273 | mask_interrupts |
274 | 274 | ld.w r1, r0[TI_flags] |
275 | 275 | |
276 | 276 | 1: bld r1, TIF_NEED_RESCHED |
277 | 277 | brcc 2f |
278 | 278 | unmask_interrupts |
279 | - rcall schedule | |
279 | + call schedule | |
280 | 280 | mask_interrupts |
281 | 281 | ld.w r1, r0[TI_flags] |
282 | 282 | rjmp 1b |
... | ... | @@ -287,7 +287,7 @@ |
287 | 287 | unmask_interrupts |
288 | 288 | mov r12, sp |
289 | 289 | mov r11, r0 |
290 | - rcall do_notify_resume | |
290 | + call do_notify_resume | |
291 | 291 | mask_interrupts |
292 | 292 | ld.w r1, r0[TI_flags] |
293 | 293 | rjmp 1b |
... | ... | @@ -394,7 +394,7 @@ |
394 | 394 | |
395 | 395 | mfsr r12, SYSREG_ECR |
396 | 396 | mov r11, sp |
397 | - rcall do_critical_exception | |
397 | + call do_critical_exception | |
398 | 398 | |
399 | 399 | /* We should never get here... */ |
400 | 400 | bad_return: |
401 | 401 | |
402 | 402 | |
... | ... | @@ -407,18 +407,18 @@ |
407 | 407 | do_bus_error_write: |
408 | 408 | sub sp, 4 |
409 | 409 | stmts --sp, r0-lr |
410 | - rcall save_full_context_ex | |
410 | + call save_full_context_ex | |
411 | 411 | mov r11, 1 |
412 | 412 | rjmp 1f |
413 | 413 | |
414 | 414 | do_bus_error_read: |
415 | 415 | sub sp, 4 |
416 | 416 | stmts --sp, r0-lr |
417 | - rcall save_full_context_ex | |
417 | + call save_full_context_ex | |
418 | 418 | mov r11, 0 |
419 | 419 | 1: mfsr r12, SYSREG_BEAR |
420 | 420 | mov r10, sp |
421 | - rcall do_bus_error | |
421 | + call do_bus_error | |
422 | 422 | rjmp ret_from_exception |
423 | 423 | |
424 | 424 | .align 1 |
... | ... | @@ -433,7 +433,7 @@ |
433 | 433 | 1: pushm r8, r9 /* PC and SR */ |
434 | 434 | mfsr r12, SYSREG_ECR |
435 | 435 | mov r11, sp |
436 | - rcall do_nmi | |
436 | + call do_nmi | |
437 | 437 | popm r8-r9 |
438 | 438 | mtsr SYSREG_RAR_NMI, r8 |
439 | 439 | tst r0, r0 |
440 | 440 | |
441 | 441 | |
442 | 442 | |
443 | 443 | |
444 | 444 | |
... | ... | @@ -457,29 +457,29 @@ |
457 | 457 | handle_address_fault: |
458 | 458 | sub sp, 4 |
459 | 459 | stmts --sp, r0-lr |
460 | - rcall save_full_context_ex | |
460 | + call save_full_context_ex | |
461 | 461 | mfsr r12, SYSREG_ECR |
462 | 462 | mov r11, sp |
463 | - rcall do_address_exception | |
463 | + call do_address_exception | |
464 | 464 | rjmp ret_from_exception |
465 | 465 | |
466 | 466 | handle_protection_fault: |
467 | 467 | sub sp, 4 |
468 | 468 | stmts --sp, r0-lr |
469 | - rcall save_full_context_ex | |
469 | + call save_full_context_ex | |
470 | 470 | mfsr r12, SYSREG_ECR |
471 | 471 | mov r11, sp |
472 | - rcall do_page_fault | |
472 | + call do_page_fault | |
473 | 473 | rjmp ret_from_exception |
474 | 474 | |
475 | 475 | .align 1 |
476 | 476 | do_illegal_opcode_ll: |
477 | 477 | sub sp, 4 |
478 | 478 | stmts --sp, r0-lr |
479 | - rcall save_full_context_ex | |
479 | + call save_full_context_ex | |
480 | 480 | mfsr r12, SYSREG_ECR |
481 | 481 | mov r11, sp |
482 | - rcall do_illegal_opcode | |
482 | + call do_illegal_opcode | |
483 | 483 | rjmp ret_from_exception |
484 | 484 | |
485 | 485 | do_dtlb_modified: |
486 | 486 | |
... | ... | @@ -513,11 +513,11 @@ |
513 | 513 | do_fpe_ll: |
514 | 514 | sub sp, 4 |
515 | 515 | stmts --sp, r0-lr |
516 | - rcall save_full_context_ex | |
516 | + call save_full_context_ex | |
517 | 517 | unmask_interrupts |
518 | 518 | mov r12, 26 |
519 | 519 | mov r11, sp |
520 | - rcall do_fpe | |
520 | + call do_fpe | |
521 | 521 | rjmp ret_from_exception |
522 | 522 | |
523 | 523 | ret_from_exception: |
... | ... | @@ -553,7 +553,7 @@ |
553 | 553 | lddsp r4, sp[REG_SR] |
554 | 554 | bld r4, SYSREG_GM_OFFSET |
555 | 555 | brcs 1f |
556 | - rcall preempt_schedule_irq | |
556 | + call preempt_schedule_irq | |
557 | 557 | 1: |
558 | 558 | #endif |
559 | 559 | |
... | ... | @@ -582,7 +582,7 @@ |
582 | 582 | bld r1, TIF_NEED_RESCHED |
583 | 583 | brcc 1f |
584 | 584 | unmask_interrupts |
585 | - rcall schedule | |
585 | + call schedule | |
586 | 586 | mask_interrupts |
587 | 587 | ld.w r1, r0[TI_flags] |
588 | 588 | rjmp fault_exit_work |
... | ... | @@ -593,7 +593,7 @@ |
593 | 593 | unmask_interrupts |
594 | 594 | mov r12, sp |
595 | 595 | mov r11, r0 |
596 | - rcall do_notify_resume | |
596 | + call do_notify_resume | |
597 | 597 | mask_interrupts |
598 | 598 | ld.w r1, r0[TI_flags] |
599 | 599 | rjmp fault_exit_work |
600 | 600 | |
... | ... | @@ -616,10 +616,10 @@ |
616 | 616 | |
617 | 617 | .Ldebug_fixup_cont: |
618 | 618 | #ifdef CONFIG_TRACE_IRQFLAGS |
619 | - rcall trace_hardirqs_off | |
619 | + call trace_hardirqs_off | |
620 | 620 | #endif |
621 | 621 | mov r12, sp |
622 | - rcall do_debug | |
622 | + call do_debug | |
623 | 623 | mov sp, r12 |
624 | 624 | |
625 | 625 | lddsp r2, sp[REG_SR] |
... | ... | @@ -643,7 +643,7 @@ |
643 | 643 | mtsr SYSREG_RSR_DBG, r11 |
644 | 644 | mtsr SYSREG_RAR_DBG, r10 |
645 | 645 | #ifdef CONFIG_TRACE_IRQFLAGS |
646 | - rcall trace_hardirqs_on | |
646 | + call trace_hardirqs_on | |
647 | 647 | 1: |
648 | 648 | #endif |
649 | 649 | ldmts sp++, r0-lr |
... | ... | @@ -676,7 +676,7 @@ |
676 | 676 | #ifdef CONFIG_TRACE_IRQFLAGS |
677 | 677 | bld r11, SYSREG_GM_OFFSET |
678 | 678 | brcc 1f |
679 | - rcall trace_hardirqs_on | |
679 | + call trace_hardirqs_on | |
680 | 680 | 1: |
681 | 681 | #endif |
682 | 682 | mfsr r2, SYSREG_SR |
... | ... | @@ -747,7 +747,7 @@ |
747 | 747 | mov r11, sp |
748 | 748 | mov r12, \level |
749 | 749 | |
750 | - rcall do_IRQ | |
750 | + call do_IRQ | |
751 | 751 | |
752 | 752 | lddsp r4, sp[REG_SR] |
753 | 753 | bfextu r4, r4, SYSREG_M0_OFFSET, 3 |
... | ... | @@ -767,7 +767,7 @@ |
767 | 767 | |
768 | 768 | 1: |
769 | 769 | #ifdef CONFIG_TRACE_IRQFLAGS |
770 | - rcall trace_hardirqs_on | |
770 | + call trace_hardirqs_on | |
771 | 771 | #endif |
772 | 772 | popm r8-r9 |
773 | 773 | mtsr rar_int\level, r8 |
... | ... | @@ -807,7 +807,7 @@ |
807 | 807 | lddsp r4, sp[REG_SR] |
808 | 808 | bld r4, SYSREG_GM_OFFSET |
809 | 809 | brcs 1b |
810 | - rcall preempt_schedule_irq | |
810 | + call preempt_schedule_irq | |
811 | 811 | #endif |
812 | 812 | rjmp 1b |
813 | 813 | .endm |
arch/avr32/kernel/syscall-stubs.S
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | __sys_mmap2: |
62 | 62 | pushm lr |
63 | 63 | st.w --sp, ARG6 |
64 | - rcall sys_mmap2 | |
64 | + call sys_mmap2 | |
65 | 65 | sub sp, -4 |
66 | 66 | popm pc |
67 | 67 | |
... | ... | @@ -70,7 +70,7 @@ |
70 | 70 | __sys_sendto: |
71 | 71 | pushm lr |
72 | 72 | st.w --sp, ARG6 |
73 | - rcall sys_sendto | |
73 | + call sys_sendto | |
74 | 74 | sub sp, -4 |
75 | 75 | popm pc |
76 | 76 | |
... | ... | @@ -79,7 +79,7 @@ |
79 | 79 | __sys_recvfrom: |
80 | 80 | pushm lr |
81 | 81 | st.w --sp, ARG6 |
82 | - rcall sys_recvfrom | |
82 | + call sys_recvfrom | |
83 | 83 | sub sp, -4 |
84 | 84 | popm pc |
85 | 85 | |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | __sys_pselect6: |
89 | 89 | pushm lr |
90 | 90 | st.w --sp, ARG6 |
91 | - rcall sys_pselect6 | |
91 | + call sys_pselect6 | |
92 | 92 | sub sp, -4 |
93 | 93 | popm pc |
94 | 94 | |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | __sys_splice: |
98 | 98 | pushm lr |
99 | 99 | st.w --sp, ARG6 |
100 | - rcall sys_splice | |
100 | + call sys_splice | |
101 | 101 | sub sp, -4 |
102 | 102 | popm pc |
103 | 103 | |
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 | __sys_epoll_pwait: |
107 | 107 | pushm lr |
108 | 108 | st.w --sp, ARG6 |
109 | - rcall sys_epoll_pwait | |
109 | + call sys_epoll_pwait | |
110 | 110 | sub sp, -4 |
111 | 111 | popm pc |
112 | 112 | |
... | ... | @@ -115,7 +115,7 @@ |
115 | 115 | __sys_sync_file_range: |
116 | 116 | pushm lr |
117 | 117 | st.w --sp, ARG6 |
118 | - rcall sys_sync_file_range | |
118 | + call sys_sync_file_range | |
119 | 119 | sub sp, -4 |
120 | 120 | popm pc |