From 7974c088aaa069752131f72144f7b30a7839e381 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 23 May 2008 14:16:16 +0000 Subject: [PATCH] Add more farcall tests --- ld/testsuite/ld-arm/farcall-group-size2.d | 47 ++++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-group.d | 46 ++++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-group.s | 44 ++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-group2.s | 10 ++++++ ld/testsuite/ld-arm/farcall-mix.d | 44 ++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-mix.s | 46 ++++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-mix2.d | 48 +++++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-mix2.s | 51 +++++++++++++++++++++++++++++++ ld/testsuite/ld-arm/farcall-section.d | 5 +++ ld/testsuite/ld-arm/farcall-section.s | 20 ++++++++++++ 10 files changed, 361 insertions(+) create mode 100644 ld/testsuite/ld-arm/farcall-group-size2.d create mode 100644 ld/testsuite/ld-arm/farcall-group.d create mode 100644 ld/testsuite/ld-arm/farcall-group.s create mode 100644 ld/testsuite/ld-arm/farcall-group2.s create mode 100644 ld/testsuite/ld-arm/farcall-mix.d create mode 100644 ld/testsuite/ld-arm/farcall-mix.s create mode 100644 ld/testsuite/ld-arm/farcall-mix2.d create mode 100644 ld/testsuite/ld-arm/farcall-mix2.s create mode 100644 ld/testsuite/ld-arm/farcall-section.d create mode 100644 ld/testsuite/ld-arm/farcall-section.s diff --git a/ld/testsuite/ld-arm/farcall-group-size2.d b/ld/testsuite/ld-arm/farcall-group-size2.d new file mode 100644 index 0000000000..7367151a33 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-group-size2.d @@ -0,0 +1,47 @@ + +.*: file format .* + +Disassembly of section .text: + +00001000 <_start-0x18>: + 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <_start-0x14> + 1004: 02003024 .word 0x02003024 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <_start-0x8> + 100c: e12fff1c bx ip + 1010: 02003021 .word 0x02003021 + 1014: 00000000 .word 0x00000000 + +00001018 <_start>: + 1018: ebfffffa bl 1008 <_start-0x10> + 101c: ebfffff7 bl 1000 <_start-0x18> + 1020: e51ff004 ldr pc, \[pc, #-4\] ; 1024 <_start\+0xc> + 1024: 02003028 .word 0x02003028 + 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <_start\+0x18> + 102c: e12fff1c bx ip + 1030: 0200302f .word 0x0200302f + 1034: e59fc000 ldr ip, \[pc, #0\] ; 103c <_start\+0x24> + 1038: e12fff1c bx ip + 103c: 0200302d .word 0x0200302d + ... + +00001048 : + 1048: ebfffff4 bl 1020 <_start\+0x8> + 104c: ebfffff8 bl 1034 <_start\+0x1c> + 1050: ebfffff4 bl 1028 <_start\+0x10> +Disassembly of section .foo: + +02003020 : + 2003020: 4770 bx lr + ... + +02003024 : + 2003024: e12fff1e bx lr + +02003028 : + 2003028: e12fff1e bx lr + +0200302c : + 200302c: 4770 bx lr + +0200302e : + 200302e: 4770 bx lr diff --git a/ld/testsuite/ld-arm/farcall-group.d b/ld/testsuite/ld-arm/farcall-group.d new file mode 100644 index 0000000000..813344dbfb --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-group.d @@ -0,0 +1,46 @@ + +.*: file format .* + +Disassembly of section .text: + +00001000 <_start-0x40>: + 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <_start-0x3c> + 1004: 02003024 .word 0x02003024 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <_start-0x30> + 100c: e12fff1c bx ip + 1010: 02003021 .word 0x02003021 + 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <_start-0x28> + 1018: 02003028 .word 0x02003028 + 101c: e59fc000 ldr ip, \[pc, #0\] ; 1024 <_start-0x1c> + 1020: e12fff1c bx ip + 1024: 0200302d .word 0x0200302d + 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <_start-0x10> + 102c: e12fff1c bx ip + 1030: 0200302f .word 0x0200302f + ... + +00001040 <_start>: + 1040: ebfffff0 bl 1008 <_start-0x38> + 1044: ebffffed bl 1000 <_start-0x40> + +00001048 : + 1048: ebfffff1 bl 1014 <_start-0x2c> + 104c: ebfffff2 bl 101c <_start-0x24> + 1050: ebfffff4 bl 1028 <_start-0x18> +Disassembly of section .foo: + +02003020 : + 2003020: 4770 bx lr + ... + +02003024 : + 2003024: e12fff1e bx lr + +02003028 : + 2003028: e12fff1e bx lr + +0200302c : + 200302c: 4770 bx lr + +0200302e : + 200302e: 4770 bx lr diff --git a/ld/testsuite/ld-arm/farcall-group.s b/ld/testsuite/ld-arm/farcall-group.s new file mode 100644 index 0000000000..0ede36df4f --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-group.s @@ -0,0 +1,44 @@ +@ Test to ensure that ARM calls exceeding 32Mb generate stubs. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + bl bar2 + + +@ We will place the section .foo at 0x2003020. + + .section .foo, "xa" + + .global bar + .thumb_func +bar: + bx lr + + .arm + .global bar2 + .type bar2, %function +bar2: + bx lr + + .global bar3 + .type bar3, %function +bar3: + bx lr + + .global bar4 + .thumb_func +bar4: + bx lr + + .global bar5 + .type bar5, %function +bar5: + bx lr + diff --git a/ld/testsuite/ld-arm/farcall-group2.s b/ld/testsuite/ld-arm/farcall-group2.s new file mode 100644 index 0000000000..4624804919 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-group2.s @@ -0,0 +1,10 @@ + +@ Test to ensure that ARM calls exceeding 32Mb generate stubs. + +@ We will place the section .foo at 0x2000. + + .text +myfunc: + bl bar3 + bl bar4 + bl bar5 diff --git a/ld/testsuite/ld-arm/farcall-mix.d b/ld/testsuite/ld-arm/farcall-mix.d new file mode 100644 index 0000000000..8a00798d48 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-mix.d @@ -0,0 +1,44 @@ + +.*: file format .* + +Disassembly of section .text: + +00001000 <_start-0x40>: + 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <_start-0x3c> + 1004: 02002024 .word 0x02002024 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <_start-0x30> + 100c: e12fff1c bx ip + 1010: 02002021 .word 0x02002021 + 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <_start-0x28> + 1018: 02002028 .word 0x02002028 + 101c: e59fc000 ldr ip, \[pc, #0\] ; 1024 <_start-0x1c> + 1020: e12fff1c bx ip + 1024: 0200202d .word 0x0200202d + 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <_start-0x10> + 102c: e12fff1c bx ip + 1030: 0200202f .word 0x0200202f + ... + +00001040 <_start>: + 1040: ebfffff0 bl 1008 <_start-0x38> + 1044: ebffffed bl 1000 <_start-0x40> + 1048: ebfffff1 bl 1014 <_start-0x2c> + 104c: ebfffff2 bl 101c <_start-0x24> + 1050: ebfffff4 bl 1028 <_start-0x18> +Disassembly of section .foo: + +02002020 : + 2002020: 4770 bx lr + ... + +02002024 : + 2002024: e12fff1e bx lr + +02002028 : + 2002028: e12fff1e bx lr + +0200202c : + 200202c: 4770 bx lr + +0200202e : + 200202e: 4770 bx lr diff --git a/ld/testsuite/ld-arm/farcall-mix.s b/ld/testsuite/ld-arm/farcall-mix.s new file mode 100644 index 0000000000..41b27f2d44 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-mix.s @@ -0,0 +1,46 @@ +@ Test to ensure that ARM calls exceeding 32Mb generate stubs. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + bl bar2 + bl bar3 + bl bar4 + bl bar5 + +@ We will place the section .foo at 0x2002020. + + .section .foo, "xa" + + .global bar + .thumb_func +bar: + bx lr + + .arm + .global bar2 + .type bar2, %function +bar2: + bx lr + + .global bar3 + .type bar3, %function +bar3: + bx lr + + .global bar4 + .thumb_func +bar4: + bx lr + + .global bar5 + .type bar5, %function +bar5: + bx lr + diff --git a/ld/testsuite/ld-arm/farcall-mix2.d b/ld/testsuite/ld-arm/farcall-mix2.d new file mode 100644 index 0000000000..eb70843f8e --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-mix2.d @@ -0,0 +1,48 @@ + +.*: file format .* + +Disassembly of section .text: + +00001000 <_start-0x18>: + 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <_start-0x14> + 1004: 02003024 .word 0x02003024 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <_start-0x8> + 100c: e12fff1c bx ip + 1010: 02003021 .word 0x02003021 + 1014: 00000000 .word 0x00000000 + +00001018 <_start>: + 1018: ebfffffa bl 1008 <_start-0x10> + 101c: ebfffff7 bl 1000 <_start-0x18> +Disassembly of section .mytext: + +00002000 <.mytext>: + 2000: e59fc000 ldr ip, \[pc, #0\] ; 2008 <__exidx_end\+0xfe8> + 2004: e12fff1c bx ip + 2008: 0200302f .word 0x0200302f + 200c: e51ff004 ldr pc, \[pc, #-4\] ; 2010 <__exidx_end\+0xff0> + 2010: 02003028 .word 0x02003028 + 2014: e59fc000 ldr ip, \[pc, #0\] ; 201c <__exidx_end\+0xffc> + 2018: e12fff1c bx ip + 201c: 0200302d .word 0x0200302d + ... + 2028: ebfffff7 bl 200c <__exidx_end\+0xfec> + 202c: ebfffff8 bl 2014 <__exidx_end\+0xff4> + 2030: ebfffff2 bl 2000 <__exidx_end\+0xfe0> +Disassembly of section .foo: + +02003020 : + 2003020: 4770 bx lr + ... + +02003024 : + 2003024: e12fff1e bx lr + +02003028 : + 2003028: e12fff1e bx lr + +0200302c : + 200302c: 4770 bx lr + +0200302e : + 200302e: 4770 bx lr diff --git a/ld/testsuite/ld-arm/farcall-mix2.s b/ld/testsuite/ld-arm/farcall-mix2.s new file mode 100644 index 0000000000..803e8d08f8 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-mix2.s @@ -0,0 +1,51 @@ +@ Test to ensure that ARM calls exceeding 32Mb generate stubs. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + bl bar2 + + +@ We will place the section .mytext at 0x2000. + + .section .mytext, "xa" + bl bar3 + bl bar4 + bl bar5 + +@ We will place the section .foo at 0x2003020. + + .section .foo, "xa" + + .global bar + .thumb_func +bar: + bx lr + + .arm + .global bar2 + .type bar2, %function +bar2: + bx lr + + .global bar3 + .type bar3, %function +bar3: + bx lr + + .global bar4 + .thumb_func +bar4: + bx lr + + .global bar5 + .type bar5, %function +bar5: + bx lr + diff --git a/ld/testsuite/ld-arm/farcall-section.d b/ld/testsuite/ld-arm/farcall-section.d new file mode 100644 index 0000000000..4e6d37d1ae --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-section.d @@ -0,0 +1,5 @@ +#name: ARM-ARM farcall to symbol of type STT_SECTION +#source: farcall-section.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x2001014 +#error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_CALL against `.foo' diff --git a/ld/testsuite/ld-arm/farcall-section.s b/ld/testsuite/ld-arm/farcall-section.s new file mode 100644 index 0000000000..31c9038f64 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-section.s @@ -0,0 +1,20 @@ +@ Test to ensure that a ARM to ARM call exceeding 32Mb generates an error +@ if the destination is of type STT_SECTION (eg non-global symbol) + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + +@ We will place the section .foo at 0x2001020. + + .section .foo, "xa" + +bar: + bx lr + -- 2.11.0