diff options
author | Ben Nizette <bn@niasdigital.com> | 2009-01-13 17:32:19 -0500 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2009-01-16 03:31:57 -0500 |
commit | 8d29b7b9f81d6b83d869ff054e6c189d6da73f1f (patch) | |
tree | dab61206aa71a650f53adb52bf02c17f7cd7a787 /arch/avr32/kernel | |
parent | 7cb36b6ccdca03bd87e8faca7fd920643dd1aec7 (diff) |
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>
Diffstat (limited to 'arch/avr32/kernel')
-rw-r--r-- | arch/avr32/kernel/entry-avr32b.S | 60 | ||||
-rw-r--r-- | arch/avr32/kernel/syscall-stubs.S | 14 |
2 files changed, 37 insertions, 37 deletions
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S index 33d49377b8be..009a80155d67 100644 --- a/arch/avr32/kernel/entry-avr32b.S +++ b/arch/avr32/kernel/entry-avr32b.S | |||
@@ -150,10 +150,10 @@ page_not_present: | |||
150 | tlbmiss_restore | 150 | tlbmiss_restore |
151 | sub sp, 4 | 151 | sub sp, 4 |
152 | stmts --sp, r0-lr | 152 | stmts --sp, r0-lr |
153 | rcall save_full_context_ex | 153 | call save_full_context_ex |
154 | mfsr r12, SYSREG_ECR | 154 | mfsr r12, SYSREG_ECR |
155 | mov r11, sp | 155 | mov r11, sp |
156 | rcall do_page_fault | 156 | call do_page_fault |
157 | rjmp ret_from_exception | 157 | rjmp ret_from_exception |
158 | 158 | ||
159 | .align 2 | 159 | .align 2 |
@@ -250,7 +250,7 @@ syscall_badsys: | |||
250 | 250 | ||
251 | .global ret_from_fork | 251 | .global ret_from_fork |
252 | ret_from_fork: | 252 | ret_from_fork: |
253 | rcall schedule_tail | 253 | call schedule_tail |
254 | 254 | ||
255 | /* check for syscall tracing */ | 255 | /* check for syscall tracing */ |
256 | get_thread_info r0 | 256 | get_thread_info r0 |
@@ -261,7 +261,7 @@ ret_from_fork: | |||
261 | 261 | ||
262 | syscall_trace_enter: | 262 | syscall_trace_enter: |
263 | pushm r8-r12 | 263 | pushm r8-r12 |
264 | rcall syscall_trace | 264 | call syscall_trace |
265 | popm r8-r12 | 265 | popm r8-r12 |
266 | rjmp syscall_trace_cont | 266 | rjmp syscall_trace_cont |
267 | 267 | ||
@@ -269,14 +269,14 @@ syscall_exit_work: | |||
269 | bld r1, TIF_SYSCALL_TRACE | 269 | bld r1, TIF_SYSCALL_TRACE |
270 | brcc 1f | 270 | brcc 1f |
271 | unmask_interrupts | 271 | unmask_interrupts |
272 | rcall syscall_trace | 272 | call syscall_trace |
273 | mask_interrupts | 273 | mask_interrupts |
274 | ld.w r1, r0[TI_flags] | 274 | ld.w r1, r0[TI_flags] |
275 | 275 | ||
276 | 1: bld r1, TIF_NEED_RESCHED | 276 | 1: bld r1, TIF_NEED_RESCHED |
277 | brcc 2f | 277 | brcc 2f |
278 | unmask_interrupts | 278 | unmask_interrupts |
279 | rcall schedule | 279 | call schedule |
280 | mask_interrupts | 280 | mask_interrupts |
281 | ld.w r1, r0[TI_flags] | 281 | ld.w r1, r0[TI_flags] |
282 | rjmp 1b | 282 | rjmp 1b |
@@ -287,7 +287,7 @@ syscall_exit_work: | |||
287 | unmask_interrupts | 287 | unmask_interrupts |
288 | mov r12, sp | 288 | mov r12, sp |
289 | mov r11, r0 | 289 | mov r11, r0 |
290 | rcall do_notify_resume | 290 | call do_notify_resume |
291 | mask_interrupts | 291 | mask_interrupts |
292 | ld.w r1, r0[TI_flags] | 292 | ld.w r1, r0[TI_flags] |
293 | rjmp 1b | 293 | rjmp 1b |
@@ -394,7 +394,7 @@ handle_critical: | |||
394 | 394 | ||
395 | mfsr r12, SYSREG_ECR | 395 | mfsr r12, SYSREG_ECR |
396 | mov r11, sp | 396 | mov r11, sp |
397 | rcall do_critical_exception | 397 | call do_critical_exception |
398 | 398 | ||
399 | /* We should never get here... */ | 399 | /* We should never get here... */ |
400 | bad_return: | 400 | bad_return: |
@@ -407,18 +407,18 @@ bad_return: | |||
407 | do_bus_error_write: | 407 | do_bus_error_write: |
408 | sub sp, 4 | 408 | sub sp, 4 |
409 | stmts --sp, r0-lr | 409 | stmts --sp, r0-lr |
410 | rcall save_full_context_ex | 410 | call save_full_context_ex |
411 | mov r11, 1 | 411 | mov r11, 1 |
412 | rjmp 1f | 412 | rjmp 1f |
413 | 413 | ||
414 | do_bus_error_read: | 414 | do_bus_error_read: |
415 | sub sp, 4 | 415 | sub sp, 4 |
416 | stmts --sp, r0-lr | 416 | stmts --sp, r0-lr |
417 | rcall save_full_context_ex | 417 | call save_full_context_ex |
418 | mov r11, 0 | 418 | mov r11, 0 |
419 | 1: mfsr r12, SYSREG_BEAR | 419 | 1: mfsr r12, SYSREG_BEAR |
420 | mov r10, sp | 420 | mov r10, sp |
421 | rcall do_bus_error | 421 | call do_bus_error |
422 | rjmp ret_from_exception | 422 | rjmp ret_from_exception |
423 | 423 | ||
424 | .align 1 | 424 | .align 1 |
@@ -433,7 +433,7 @@ do_nmi_ll: | |||
433 | 1: pushm r8, r9 /* PC and SR */ | 433 | 1: pushm r8, r9 /* PC and SR */ |
434 | mfsr r12, SYSREG_ECR | 434 | mfsr r12, SYSREG_ECR |
435 | mov r11, sp | 435 | mov r11, sp |
436 | rcall do_nmi | 436 | call do_nmi |
437 | popm r8-r9 | 437 | popm r8-r9 |
438 | mtsr SYSREG_RAR_NMI, r8 | 438 | mtsr SYSREG_RAR_NMI, r8 |
439 | tst r0, r0 | 439 | tst r0, r0 |
@@ -457,29 +457,29 @@ do_nmi_ll: | |||
457 | handle_address_fault: | 457 | handle_address_fault: |
458 | sub sp, 4 | 458 | sub sp, 4 |
459 | stmts --sp, r0-lr | 459 | stmts --sp, r0-lr |
460 | rcall save_full_context_ex | 460 | call save_full_context_ex |
461 | mfsr r12, SYSREG_ECR | 461 | mfsr r12, SYSREG_ECR |
462 | mov r11, sp | 462 | mov r11, sp |
463 | rcall do_address_exception | 463 | call do_address_exception |
464 | rjmp ret_from_exception | 464 | rjmp ret_from_exception |
465 | 465 | ||
466 | handle_protection_fault: | 466 | handle_protection_fault: |
467 | sub sp, 4 | 467 | sub sp, 4 |
468 | stmts --sp, r0-lr | 468 | stmts --sp, r0-lr |
469 | rcall save_full_context_ex | 469 | call save_full_context_ex |
470 | mfsr r12, SYSREG_ECR | 470 | mfsr r12, SYSREG_ECR |
471 | mov r11, sp | 471 | mov r11, sp |
472 | rcall do_page_fault | 472 | call do_page_fault |
473 | rjmp ret_from_exception | 473 | rjmp ret_from_exception |
474 | 474 | ||
475 | .align 1 | 475 | .align 1 |
476 | do_illegal_opcode_ll: | 476 | do_illegal_opcode_ll: |
477 | sub sp, 4 | 477 | sub sp, 4 |
478 | stmts --sp, r0-lr | 478 | stmts --sp, r0-lr |
479 | rcall save_full_context_ex | 479 | call save_full_context_ex |
480 | mfsr r12, SYSREG_ECR | 480 | mfsr r12, SYSREG_ECR |
481 | mov r11, sp | 481 | mov r11, sp |
482 | rcall do_illegal_opcode | 482 | call do_illegal_opcode |
483 | rjmp ret_from_exception | 483 | rjmp ret_from_exception |
484 | 484 | ||
485 | do_dtlb_modified: | 485 | do_dtlb_modified: |
@@ -513,11 +513,11 @@ do_dtlb_modified: | |||
513 | do_fpe_ll: | 513 | do_fpe_ll: |
514 | sub sp, 4 | 514 | sub sp, 4 |
515 | stmts --sp, r0-lr | 515 | stmts --sp, r0-lr |
516 | rcall save_full_context_ex | 516 | call save_full_context_ex |
517 | unmask_interrupts | 517 | unmask_interrupts |
518 | mov r12, 26 | 518 | mov r12, 26 |
519 | mov r11, sp | 519 | mov r11, sp |
520 | rcall do_fpe | 520 | call do_fpe |
521 | rjmp ret_from_exception | 521 | rjmp ret_from_exception |
522 | 522 | ||
523 | ret_from_exception: | 523 | ret_from_exception: |
@@ -553,7 +553,7 @@ fault_resume_kernel: | |||
553 | lddsp r4, sp[REG_SR] | 553 | lddsp r4, sp[REG_SR] |
554 | bld r4, SYSREG_GM_OFFSET | 554 | bld r4, SYSREG_GM_OFFSET |
555 | brcs 1f | 555 | brcs 1f |
556 | rcall preempt_schedule_irq | 556 | call preempt_schedule_irq |
557 | 1: | 557 | 1: |
558 | #endif | 558 | #endif |
559 | 559 | ||
@@ -582,7 +582,7 @@ fault_exit_work: | |||
582 | bld r1, TIF_NEED_RESCHED | 582 | bld r1, TIF_NEED_RESCHED |
583 | brcc 1f | 583 | brcc 1f |
584 | unmask_interrupts | 584 | unmask_interrupts |
585 | rcall schedule | 585 | call schedule |
586 | mask_interrupts | 586 | mask_interrupts |
587 | ld.w r1, r0[TI_flags] | 587 | ld.w r1, r0[TI_flags] |
588 | rjmp fault_exit_work | 588 | rjmp fault_exit_work |
@@ -593,7 +593,7 @@ fault_exit_work: | |||
593 | unmask_interrupts | 593 | unmask_interrupts |
594 | mov r12, sp | 594 | mov r12, sp |
595 | mov r11, r0 | 595 | mov r11, r0 |
596 | rcall do_notify_resume | 596 | call do_notify_resume |
597 | mask_interrupts | 597 | mask_interrupts |
598 | ld.w r1, r0[TI_flags] | 598 | ld.w r1, r0[TI_flags] |
599 | rjmp fault_exit_work | 599 | rjmp fault_exit_work |
@@ -616,10 +616,10 @@ handle_debug: | |||
616 | 616 | ||
617 | .Ldebug_fixup_cont: | 617 | .Ldebug_fixup_cont: |
618 | #ifdef CONFIG_TRACE_IRQFLAGS | 618 | #ifdef CONFIG_TRACE_IRQFLAGS |
619 | rcall trace_hardirqs_off | 619 | call trace_hardirqs_off |
620 | #endif | 620 | #endif |
621 | mov r12, sp | 621 | mov r12, sp |
622 | rcall do_debug | 622 | call do_debug |
623 | mov sp, r12 | 623 | mov sp, r12 |
624 | 624 | ||
625 | lddsp r2, sp[REG_SR] | 625 | lddsp r2, sp[REG_SR] |
@@ -643,7 +643,7 @@ handle_debug: | |||
643 | mtsr SYSREG_RSR_DBG, r11 | 643 | mtsr SYSREG_RSR_DBG, r11 |
644 | mtsr SYSREG_RAR_DBG, r10 | 644 | mtsr SYSREG_RAR_DBG, r10 |
645 | #ifdef CONFIG_TRACE_IRQFLAGS | 645 | #ifdef CONFIG_TRACE_IRQFLAGS |
646 | rcall trace_hardirqs_on | 646 | call trace_hardirqs_on |
647 | 1: | 647 | 1: |
648 | #endif | 648 | #endif |
649 | ldmts sp++, r0-lr | 649 | ldmts sp++, r0-lr |
@@ -676,7 +676,7 @@ debug_resume_kernel: | |||
676 | #ifdef CONFIG_TRACE_IRQFLAGS | 676 | #ifdef CONFIG_TRACE_IRQFLAGS |
677 | bld r11, SYSREG_GM_OFFSET | 677 | bld r11, SYSREG_GM_OFFSET |
678 | brcc 1f | 678 | brcc 1f |
679 | rcall trace_hardirqs_on | 679 | call trace_hardirqs_on |
680 | 1: | 680 | 1: |
681 | #endif | 681 | #endif |
682 | mfsr r2, SYSREG_SR | 682 | mfsr r2, SYSREG_SR |
@@ -747,7 +747,7 @@ irq_level\level: | |||
747 | mov r11, sp | 747 | mov r11, sp |
748 | mov r12, \level | 748 | mov r12, \level |
749 | 749 | ||
750 | rcall do_IRQ | 750 | call do_IRQ |
751 | 751 | ||
752 | lddsp r4, sp[REG_SR] | 752 | lddsp r4, sp[REG_SR] |
753 | bfextu r4, r4, SYSREG_M0_OFFSET, 3 | 753 | bfextu r4, r4, SYSREG_M0_OFFSET, 3 |
@@ -767,7 +767,7 @@ irq_level\level: | |||
767 | 767 | ||
768 | 1: | 768 | 1: |
769 | #ifdef CONFIG_TRACE_IRQFLAGS | 769 | #ifdef CONFIG_TRACE_IRQFLAGS |
770 | rcall trace_hardirqs_on | 770 | call trace_hardirqs_on |
771 | #endif | 771 | #endif |
772 | popm r8-r9 | 772 | popm r8-r9 |
773 | mtsr rar_int\level, r8 | 773 | mtsr rar_int\level, r8 |
@@ -807,7 +807,7 @@ irq_level\level: | |||
807 | lddsp r4, sp[REG_SR] | 807 | lddsp r4, sp[REG_SR] |
808 | bld r4, SYSREG_GM_OFFSET | 808 | bld r4, SYSREG_GM_OFFSET |
809 | brcs 1b | 809 | brcs 1b |
810 | rcall preempt_schedule_irq | 810 | call preempt_schedule_irq |
811 | #endif | 811 | #endif |
812 | rjmp 1b | 812 | rjmp 1b |
813 | .endm | 813 | .endm |
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S index 673178e235f3..f7244cd02fbb 100644 --- a/arch/avr32/kernel/syscall-stubs.S +++ b/arch/avr32/kernel/syscall-stubs.S | |||
@@ -61,7 +61,7 @@ __sys_execve: | |||
61 | __sys_mmap2: | 61 | __sys_mmap2: |
62 | pushm lr | 62 | pushm lr |
63 | st.w --sp, ARG6 | 63 | st.w --sp, ARG6 |
64 | rcall sys_mmap2 | 64 | call sys_mmap2 |
65 | sub sp, -4 | 65 | sub sp, -4 |
66 | popm pc | 66 | popm pc |
67 | 67 | ||
@@ -70,7 +70,7 @@ __sys_mmap2: | |||
70 | __sys_sendto: | 70 | __sys_sendto: |
71 | pushm lr | 71 | pushm lr |
72 | st.w --sp, ARG6 | 72 | st.w --sp, ARG6 |
73 | rcall sys_sendto | 73 | call sys_sendto |
74 | sub sp, -4 | 74 | sub sp, -4 |
75 | popm pc | 75 | popm pc |
76 | 76 | ||
@@ -79,7 +79,7 @@ __sys_sendto: | |||
79 | __sys_recvfrom: | 79 | __sys_recvfrom: |
80 | pushm lr | 80 | pushm lr |
81 | st.w --sp, ARG6 | 81 | st.w --sp, ARG6 |
82 | rcall sys_recvfrom | 82 | call sys_recvfrom |
83 | sub sp, -4 | 83 | sub sp, -4 |
84 | popm pc | 84 | popm pc |
85 | 85 | ||
@@ -88,7 +88,7 @@ __sys_recvfrom: | |||
88 | __sys_pselect6: | 88 | __sys_pselect6: |
89 | pushm lr | 89 | pushm lr |
90 | st.w --sp, ARG6 | 90 | st.w --sp, ARG6 |
91 | rcall sys_pselect6 | 91 | call sys_pselect6 |
92 | sub sp, -4 | 92 | sub sp, -4 |
93 | popm pc | 93 | popm pc |
94 | 94 | ||
@@ -97,7 +97,7 @@ __sys_pselect6: | |||
97 | __sys_splice: | 97 | __sys_splice: |
98 | pushm lr | 98 | pushm lr |
99 | st.w --sp, ARG6 | 99 | st.w --sp, ARG6 |
100 | rcall sys_splice | 100 | call sys_splice |
101 | sub sp, -4 | 101 | sub sp, -4 |
102 | popm pc | 102 | popm pc |
103 | 103 | ||
@@ -106,7 +106,7 @@ __sys_splice: | |||
106 | __sys_epoll_pwait: | 106 | __sys_epoll_pwait: |
107 | pushm lr | 107 | pushm lr |
108 | st.w --sp, ARG6 | 108 | st.w --sp, ARG6 |
109 | rcall sys_epoll_pwait | 109 | call sys_epoll_pwait |
110 | sub sp, -4 | 110 | sub sp, -4 |
111 | popm pc | 111 | popm pc |
112 | 112 | ||
@@ -115,6 +115,6 @@ __sys_epoll_pwait: | |||
115 | __sys_sync_file_range: | 115 | __sys_sync_file_range: |
116 | pushm lr | 116 | pushm lr |
117 | st.w --sp, ARG6 | 117 | st.w --sp, ARG6 |
118 | rcall sys_sync_file_range | 118 | call sys_sync_file_range |
119 | sub sp, -4 | 119 | sub sp, -4 |
120 | popm pc | 120 | popm pc |