aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-01-06 21:47:38 +0000
committerDaniel Jacobowitz <drow@false.org>2004-01-06 21:47:38 +0000
commit2e73b915a9776e820c6917a426a7d35ae8fafa8f (patch)
tree217b816aff307895c543cc7f5daad79f4af1ccb9 /ld
parentf8d4bac4a7e3191ca9453db42c79b2709f946bd9 (diff)
downloadgdb-2e73b915a9776e820c6917a426a7d35ae8fafa8f.zip
gdb-2e73b915a9776e820c6917a426a7d35ae8fafa8f.tar.gz
gdb-2e73b915a9776e820c6917a426a7d35ae8fafa8f.tar.bz2
* ld-arm/arm-app.d, ld-arm/arm-app.r, ld-arm/arm-app.s,
ld-arm/arm-lib.d, ld-arm/arm-lib.r, ld-arm/arm-lib.s, ld-arm/arm-lib-plt32.d, ld-arm/arm-lib-plt32.r, ld-arm/arm-lib-plt32.s, ld-arm/arm-elf.exp: New files.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-arm/arm-app.d35
-rw-r--r--ld/testsuite/ld-arm/arm-app.r9
-rw-r--r--ld/testsuite/ld-arm/arm-app.s23
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp46
-rw-r--r--ld/testsuite/ld-arm/arm-lib-plt32.d28
-rw-r--r--ld/testsuite/ld-arm/arm-lib-plt32.r8
-rw-r--r--ld/testsuite/ld-arm/arm-lib-plt32.s17
-rw-r--r--ld/testsuite/ld-arm/arm-lib.d17
-rw-r--r--ld/testsuite/ld-arm/arm-lib.r8
-rw-r--r--ld/testsuite/ld-arm/arm-lib.s24
11 files changed, 222 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 7889ca6..56416cc 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-06 Daniel Jacobowitz <drow@mvista.com>
+
+ * ld-arm/arm-app.d, ld-arm/arm-app.r, ld-arm/arm-app.s,
+ ld-arm/arm-lib.d, ld-arm/arm-lib.r, ld-arm/arm-lib.s,
+ ld-arm/arm-lib-plt32.d, ld-arm/arm-lib-plt32.r,
+ ld-arm/arm-lib-plt32.s, ld-arm/arm-elf.exp: New files.
+
2004-01-06 Alexandre Oliva <aoliva@redhat.com>
* ld-frv: Update .d files with correct addresses displayed for
diff --git a/ld/testsuite/ld-arm/arm-app.d b/ld/testsuite/ld-arm/arm-app.d
new file mode 100644
index 0000000..ae48f53a
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-app.d
@@ -0,0 +1,35 @@
+
+tmpdir/arm-app: file format elf32-littlearm
+architecture: arm, flags 0x00000112:
+EXEC_P, HAS_SYMS, D_PAGED
+start address 0x.*
+
+Disassembly of section .plt:
+
+.* <.plt>:
+ .*: e52de004 str lr, \[sp, #-4\]!
+ .*: e59fe004 ldr lr, \[pc, #4\] ; .* <.plt\+0x10>
+ .*: e08fe00e add lr, pc, lr
+ .*: e5bef008 ldr pc, \[lr, #8\]!
+ .*: .*
+ .*: e28fc6.* add ip, pc, #.* ; 0x.*
+ .*: e28cca.* add ip, ip, #.* ; 0x.*
+ .*: e5bcf.* ldr pc, \[ip, #.*\]!
+Disassembly of section .text:
+
+.* <_start>:
+ .*: e1a0c00d mov ip, sp
+ .*: e92dd800 stmdb sp!, {fp, ip, lr, pc}
+ .*: eb000001 bl .* <app_func>
+ .*: e89d6800 ldmia sp, {fp, sp, lr}
+ .*: e12fff1e bx lr
+
+.* <app_func>:
+ .*: e1a0c00d mov ip, sp
+ .*: e92dd800 stmdb sp!, {fp, ip, lr, pc}
+ .*: ebfffff4 bl .* <.text-0xc>
+ .*: e89d6800 ldmia sp, {fp, sp, lr}
+ .*: e12fff1e bx lr
+
+.* <app_func2>:
+ .*: e12fff1e bx lr
diff --git a/ld/testsuite/ld-arm/arm-app.r b/ld/testsuite/ld-arm/arm-app.r
new file mode 100644
index 0000000..f2433ce
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-app.r
@@ -0,0 +1,9 @@
+
+tmpdir/arm-app: file format elf32-littlearm
+
+DYNAMIC RELOCATION RECORDS
+OFFSET TYPE VALUE
+.* R_ARM_COPY data_obj
+.* R_ARM_JUMP_SLOT lib_func1
+
+
diff --git a/ld/testsuite/ld-arm/arm-app.s b/ld/testsuite/ld-arm/arm-app.s
new file mode 100644
index 0000000..8f6d27c
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-app.s
@@ -0,0 +1,23 @@
+ .text
+ .globl _start
+_start:
+ mov ip, sp
+ stmdb sp!, {r11, ip, lr, pc}
+ bl app_func
+ ldmia sp, {r11, sp, lr}
+ bx lr
+
+ .globl app_func
+app_func:
+ mov ip, sp
+ stmdb sp!, {r11, ip, lr, pc}
+ bl lib_func1
+ ldmia sp, {r11, sp, lr}
+ bx lr
+
+ .globl app_func2
+app_func2:
+ bx lr
+
+ .data
+ .long data_obj
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
new file mode 100644
index 0000000..0f99741
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -0,0 +1,46 @@
+# Expect script for various ARM ELF tests.
+# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# Exclude non-ARM-ELF targets.
+
+if { ![is_elf_format] || ![istarget "arm*-*-*"] } {
+ return
+}
+
+# List contains test-items with 3 items followed by 2 lists:
+# 0:name 1:ld options 2:assembler options
+# 3:filenames of assembler files 4: action and options. 5: name of output file
+
+# Actions:
+# objdump: Apply objdump options on result. Compare with regex (last arg).
+# nm: Apply nm options on result. Compare with regex (last arg).
+# readelf: Apply readelf options on result. Compare with regex (last arg).
+
+set armelftests {
+ {"Simple non-PIC shared library" "-shared" "" {arm-lib.s}
+ {{objdump -fdw arm-lib.d} {objdump -Rw arm-lib.r}}
+ "arm-lib.so"}
+ {"Simple PIC shared library" "-shared" "" {arm-lib-plt32.s}
+ {{objdump -fdw arm-lib-plt32.d} {objdump -Rw arm-lib-plt32.r}}
+ "arm-lib-plt32.so"}
+ {"Simple dynamic application" "tmpdir/arm-lib.so" "" {arm-app.s}
+ {{objdump -fdw arm-app.d} {objdump -Rw arm-app.r}}
+ "arm-app"}
+}
+
+run_ld_link_tests $armelftests
diff --git a/ld/testsuite/ld-arm/arm-lib-plt32.d b/ld/testsuite/ld-arm/arm-lib-plt32.d
new file mode 100644
index 0000000..449b0f9
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib-plt32.d
@@ -0,0 +1,28 @@
+
+tmpdir/arm-lib-plt32.so: file format elf32-littlearm
+architecture: arm, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x.*
+
+Disassembly of section .plt:
+
+.* <.plt>:
+ .*: e52de004 str lr, \[sp, #-4\]!
+ .*: e59fe004 ldr lr, \[pc, #4\] ; .* <lib_func1-0x10>
+ .*: e08fe00e add lr, pc, lr
+ .*: e5bef008 ldr pc, \[lr, #8\]!
+ .*: .*
+ .*: e28fc6.* add ip, pc, #.* ; 0x.*
+ .*: e28cca.* add ip, ip, #.* ; 0x.*
+ .*: e5bcf.* ldr pc, \[ip, #.*\]!
+Disassembly of section .text:
+
+.* <lib_func1>:
+ .*: e1a0c00d mov ip, sp
+ .*: e92dd800 stmdb sp!, {fp, ip, lr, pc}
+ .*: ebfffff9 bl .* <lib_func1-0xc>
+ .*: e89d6800 ldmia sp, {fp, sp, lr}
+ .*: e12fff1e bx lr
+
+.* <lib_func2>:
+ .*: e12fff1e bx lr
diff --git a/ld/testsuite/ld-arm/arm-lib-plt32.r b/ld/testsuite/ld-arm/arm-lib-plt32.r
new file mode 100644
index 0000000..2212493
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib-plt32.r
@@ -0,0 +1,8 @@
+
+tmpdir/arm-lib-plt32.so: file format elf32-littlearm
+
+DYNAMIC RELOCATION RECORDS
+OFFSET TYPE VALUE
+.* R_ARM_JUMP_SLOT app_func2
+
+
diff --git a/ld/testsuite/ld-arm/arm-lib-plt32.s b/ld/testsuite/ld-arm/arm-lib-plt32.s
new file mode 100644
index 0000000..d6c4787
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib-plt32.s
@@ -0,0 +1,17 @@
+ .text
+
+ .globl lib_func1
+ .type lib_func1, %function
+lib_func1:
+ mov ip, sp
+ stmdb sp!, {r11, ip, lr, pc}
+ bl app_func2(PLT)
+ ldmia sp, {r11, sp, lr}
+ bx lr
+ .size lib_func1, . - lib_func1
+
+ .globl lib_func2
+ .type lib_func2, %function
+lib_func2:
+ bx lr
+ .size lib_func2, . - lib_func2
diff --git a/ld/testsuite/ld-arm/arm-lib.d b/ld/testsuite/ld-arm/arm-lib.d
new file mode 100644
index 0000000..d0fb714
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib.d
@@ -0,0 +1,17 @@
+
+tmpdir/arm-lib.so: file format elf32-littlearm
+architecture: arm, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x.*
+
+Disassembly of section .text:
+
+.* <lib_func1>:
+ .*: e1a0c00d mov ip, sp
+ .*: e92dd800 stmdb sp!, {fp, ip, lr, pc}
+ .*: ebfffffe bl .* <lib_func1\+0x8>
+ .*: e89d6800 ldmia sp, {fp, sp, lr}
+ .*: e12fff1e bx lr
+
+.* <lib_func2>:
+ .*: e12fff1e bx lr
diff --git a/ld/testsuite/ld-arm/arm-lib.r b/ld/testsuite/ld-arm/arm-lib.r
new file mode 100644
index 0000000..33ba781
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib.r
@@ -0,0 +1,8 @@
+
+tmpdir/arm-lib.so: file format elf32-littlearm
+
+DYNAMIC RELOCATION RECORDS
+OFFSET TYPE VALUE
+.* R_ARM_PC24 app_func2
+
+
diff --git a/ld/testsuite/ld-arm/arm-lib.s b/ld/testsuite/ld-arm/arm-lib.s
new file mode 100644
index 0000000..949f61c
--- /dev/null
+++ b/ld/testsuite/ld-arm/arm-lib.s
@@ -0,0 +1,24 @@
+ .text
+
+ .globl lib_func1
+ .type lib_func1, %function
+lib_func1:
+ mov ip, sp
+ stmdb sp!, {r11, ip, lr, pc}
+ bl app_func2
+ ldmia sp, {r11, sp, lr}
+ bx lr
+ .size lib_func1, . - lib_func1
+
+ .globl lib_func2
+ .type lib_func2, %function
+lib_func2:
+ bx lr
+ .size lib_func2, . - lib_func2
+
+ .data
+ .globl data_obj
+ .type data_obj, %object
+data_obj:
+ .long 0
+ .size data_obj, . - data_obj