aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2009-06-22 10:55:33 +0000
committerChristophe Lyon <christophe.lyon@st.com>2009-06-22 10:55:33 +0000
commit022f83127a7d608506b67ae5b7ce7960c446895d (patch)
treeb40846b791fcba677a33c299516e68cc5f7097d4 /ld
parent11275b5ad5433ffa55d7b1331c102be58250d3d8 (diff)
downloadgdb-022f83127a7d608506b67ae5b7ce7960c446895d.zip
gdb-022f83127a7d608506b67ae5b7ce7960c446895d.tar.gz
gdb-022f83127a7d608506b67ae5b7ce7960c446895d.tar.bz2
2009-06-22 Christophe Lyon <christophe.lyon@st.com>
bfd/ * elf32-arm.c (elf32_arm_size_stubs): Use PLT address as destination for defined dynamic symbols when deciding whether to insert a stub or not. (allocate_dynrelocs): Make sure functions are not marked as Thumb when actually accessed through a PLT, even when generating a shared lib. ld/testsuite: * ld-arm/farcall-mixed-app.s: Add new references to check more modes switching. * ld-arm/farcall-mixed-lib1.s: Likewise. * ld-arm/farcall-mixed-app-v5.d: Update expected result. * farcall-mixed-app.d: Likewise. * ld-arm/farcall-mixed-lib.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog10
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-app-v5.d13
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-app.d13
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-app.s3
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-lib.d51
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-lib1.s4
6 files changed, 70 insertions, 24 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 9b4ea2d..0c3ad41 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2009-06-22 Christophe Lyon <christophe.lyon@st.com>
+
+ ld/testsuite:
+ * ld-arm/farcall-mixed-app.s: Add new references to check more
+ modes switching.
+ * ld-arm/farcall-mixed-lib1.s: Likewise.
+ * ld-arm/farcall-mixed-app-v5.d: Update expected result.
+ * farcall-mixed-app.d: Likewise.
+ * ld-arm/farcall-mixed-lib.d: Likewise.
+
2009-06-22 Dave Korn <dave.korn.cygwin@gmail.com>
* ld-pe/pe-run.exp (proc test_direct_link_dll): Fix incorrect
diff --git a/ld/testsuite/ld-arm/farcall-mixed-app-v5.d b/ld/testsuite/ld-arm/farcall-mixed-app-v5.d
index ba6c77d..d34a686 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-app-v5.d
+++ b/ld/testsuite/ld-arm/farcall-mixed-app-v5.d
@@ -25,11 +25,11 @@ Disassembly of section .text:
.*: e1a0c00d mov ip, sp
.*: e92dd800 push {fp, ip, lr, pc}
.*: eb000008 bl .* <__app_func_veneer>
+ .*: ebfffff8 bl .* <_start-0xc>
+ .*: ebfffff4 bl .* <_start-0x18>
.*: e89d6800 ldm sp, {fp, sp, lr}
.*: e12fff1e bx lr
.*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
.* <app_tfunc_close>:
.*: b500 push {lr}
@@ -49,12 +49,12 @@ Disassembly of section .far_arm:
.* <app_func>:
.*: e1a0c00d mov ip, sp
.*: e92dd800 push {fp, ip, lr, pc}
- .*: eb000008 bl .* <__lib_func1_veneer>
+ .*: eb00000a bl .* <__lib_func1_veneer>
+ .*: eb000007 bl .* <__lib_func2_veneer>
.*: e89d6800 ldm sp, {fp, sp, lr}
.*: e12fff1e bx lr
.*: e1a00000 nop \(mov r0,r0\)
.*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
.* <app_func2>:
.*: e12fff1e bx lr
@@ -62,8 +62,11 @@ Disassembly of section .far_arm:
.*: e1a00000 nop \(mov r0,r0\)
.*: e1a00000 nop \(mov r0,r0\)
+.* <__lib_func2_veneer>:
+ .*: e51ff004 ldr pc, \[pc, #-4\] ; 2100034 <__lib_func2_veneer\+0x4>
+ .*: 00008218 .word 0x00008218
.* <__lib_func1_veneer>:
- .*: e51ff004 ldr pc, \[pc, #-4\] ; 2100034 <__lib_func1_veneer\+0x4>
+ .*: e51ff004 ldr pc, \[pc, #-4\] ; 210003c <__lib_func1_veneer\+0x4>
.*: 00008224 .word 0x00008224
Disassembly of section .far_thumb:
diff --git a/ld/testsuite/ld-arm/farcall-mixed-app.d b/ld/testsuite/ld-arm/farcall-mixed-app.d
index df565e6..fac7037 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-app.d
+++ b/ld/testsuite/ld-arm/farcall-mixed-app.d
@@ -27,11 +27,11 @@ Disassembly of section .text:
.*: e1a0c00d mov ip, sp
.*: e92dd800 push {fp, ip, lr, pc}
.*: eb000008 bl .* <__app_func_veneer>
+ .*: ebfffff5 bl .* <_start-0x18>
+ .*: ebfffff1 bl .* <_start-0x24>
.*: e89d6800 ldm sp, {fp, sp, lr}
.*: e12fff1e bx lr
.*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
.* <app_tfunc_close>:
.*: b500 push {lr}
@@ -51,12 +51,12 @@ Disassembly of section .far_arm:
.* <app_func>:
.*: e1a0c00d mov ip, sp
.*: e92dd800 push {fp, ip, lr, pc}
- .*: eb000008 bl .* <__lib_func1_veneer>
+ .*: eb00000a bl .* <__lib_func1_veneer>
+ .*: eb000007 bl .* <__lib_func2_veneer>
.*: e89d6800 ldm sp, {fp, sp, lr}
.*: e12fff1e bx lr
.*: e1a00000 nop \(mov r0,r0\)
.*: e1a00000 nop \(mov r0,r0\)
- .*: e1a00000 nop \(mov r0,r0\)
.* <app_func2>:
.*: e12fff1e bx lr
@@ -64,8 +64,11 @@ Disassembly of section .far_arm:
.*: e1a00000 nop \(mov r0,r0\)
.*: e1a00000 nop \(mov r0,r0\)
+.* <__lib_func2_veneer>:
+ .*: e51ff004 ldr pc, \[pc, #-4\] ; 2100034 <__lib_func2_veneer\+0x4>
+ .*: 0000821c .word 0x0000821c
.* <__lib_func1_veneer>:
- .*: e51ff004 ldr pc, \[pc, #-4\] ; 2100034 <__lib_func1_veneer\+0x4>
+ .*: e51ff004 ldr pc, \[pc, #-4\] ; 210003c <__lib_func1_veneer\+0x4>
.*: 00008228 .word 0x00008228
Disassembly of section .far_thumb:
diff --git a/ld/testsuite/ld-arm/farcall-mixed-app.s b/ld/testsuite/ld-arm/farcall-mixed-app.s
index 78d5f65..e462ba3 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-app.s
+++ b/ld/testsuite/ld-arm/farcall-mixed-app.s
@@ -5,6 +5,8 @@ _start:
mov ip, sp
stmdb sp!, {r11, ip, lr, pc}
bl app_func
+ bl lib_func1
+ bl lib_func2
ldmia sp, {r11, sp, lr}
bx lr
@@ -30,6 +32,7 @@ app_func:
mov ip, sp
stmdb sp!, {r11, ip, lr, pc}
bl lib_func1
+ bl lib_func2
ldmia sp, {r11, sp, lr}
bx lr
diff --git a/ld/testsuite/ld-arm/farcall-mixed-lib.d b/ld/testsuite/ld-arm/farcall-mixed-lib.d
index 829db45..18e7ef0 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-lib.d
+++ b/ld/testsuite/ld-arm/farcall-mixed-lib.d
@@ -17,6 +17,13 @@ Disassembly of section .plt:
.*: e28fc6.* add ip, pc, #.* ; 0x.*
.*: e28cca.* add ip, ip, #.* ; 0x.*
.*: e5bcf.* ldr pc, \[ip, #.*\]!
+ .*: e28fc6.* add ip, pc, #.* ; 0x.*
+ .*: e28cca.* add ip, ip, #.* ; 0x.*
+ .*: e5bcf.* ldr pc, \[ip, #.*\]!
+ .*: e28fc6.* add ip, pc, #.* ; 0x.*
+ .*: e28cca.* add ip, ip, #.* ; 0x.*
+ .*: e5bcf.* ldr pc, \[ip, #.*\]!
+
Disassembly of section .text:
.* <lib_func1>:
@@ -24,46 +31,62 @@ Disassembly of section .text:
.*: e92dd800 push {fp, ip, lr, pc}
.*: ebfffff. bl .* <lib_func1-0x..?>
.*: ebfffff. bl .* <lib_func1-0x..?>
+ .*: ebfffff. bl .* <lib_func1-0x..?>
+ .*: ebfffff. bl .* <lib_func1-0x..?>
.*: e89d6800 ldm sp, {fp, sp, lr}
.*: e12fff1e bx lr
...
- .*: e1a00000 .word 0xe1a00000
- .*: e1a00000 .word 0xe1a00000
.* <lib_func2>:
- .*: f000 e806 blx 1000300 <__app_func_from_thumb>
- .*: f000 e80a blx 100030c <__app_func_weak_from_thumb>
+ .*: f000 e80e blx 1000350 <__app_func_from_thumb>
+ .*: f000 e818 blx 1000368 <__app_func_weak_from_thumb>
+ .*: f000 e810 blx 100035c <__lib_func3_from_thumb>
+ .*: f000 e81a blx 1000374 <__lib_func4_from_thumb>
.*: 4770 bx lr
.*: 46c0 nop \(mov r8, r8\)
.*: 46c0 nop \(mov r8, r8\)
.*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
+ .*: 46c0 nop \(mov r8, r8\)
.* <__app_func_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 1000308 <__app_func_from_thumb\+0x8>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 1000358 <__app_func_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: feffffa8 .word 0xfeffffa8
+ .*: feffff84 .word 0xfeffff84
+
+.* <__lib_func3_from_thumb>:
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 1000364 <__lib_func3_from_thumb\+0x8>
+ .*: e08ff00c add pc, pc, ip
+ .*: feffff90 .word 0xfeffff90
.* <__app_func_weak_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 1000314 <__app_func_weak_from_thumb\+0x8>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 1000370 <__app_func_weak_from_thumb\+0x8>
+ .*: e08ff00c add pc, pc, ip
+ .*: feffff78 .word 0xfeffff78
+
+.* <__lib_func4_from_thumb>:
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 100037c <__lib_func4_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: feffffa8 .word 0xfeffffa8
+ .*: feffff84 .word 0xfeffff84
...
.* <lib_func3>:
- .*: f000 e80c blx 200033c <__app_func_from_thumb>
- .*: f000 e804 blx 2000330 <__app_func_weak_from_thumb>
+ .*: f000 e80c blx 20003ac <__app_func_from_thumb>
+ .*: f000 e804 blx 20003a0 <__app_func_weak_from_thumb>
.*: 4770 bx lr
.*: 46c0 nop \(mov r8, r8\)
.*: 46c0 nop \(mov r8, r8\)
.*: 46c0 nop \(mov r8, r8\)
.* <__app_func_weak_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 2000338 <__app_func_weak_from_thumb\+0x8>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 20003a8 <__app_func_weak_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: fdffff84 .word 0xfdffff84
+ .*: fdffff40 .word 0xfdffff40
.* <__app_func_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 2000344 <__app_func_from_thumb\+0x8>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 20003b4 <__app_func_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: fdffff6c .word 0xfdffff6c
+ .*: fdffff28 .word 0xfdffff28
...
diff --git a/ld/testsuite/ld-arm/farcall-mixed-lib1.s b/ld/testsuite/ld-arm/farcall-mixed-lib1.s
index a64c0bb..f13e717 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-lib1.s
+++ b/ld/testsuite/ld-arm/farcall-mixed-lib1.s
@@ -14,6 +14,8 @@ lib_func1:
bl app_func
.weak app_func_weak
bl app_func_weak
+ bl lib_func3
+ bl lib_func4
ldmia sp, {r11, sp, lr}
bx lr
.size lib_func1, . - lib_func1
@@ -27,5 +29,7 @@ lib_func1:
lib_func2:
bl app_func
bl app_func_weak
+ bl lib_func3
+ bl lib_func4
bx lr
.size lib_func2, . - lib_func2