* 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.
This commit is contained in:
Daniel Jacobowitz 2004-01-06 21:47:38 +00:00
parent f8d4bac4a7
commit 2e73b915a9
11 changed files with 222 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,8 @@
tmpdir/arm-lib.so: file format elf32-littlearm
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
.* R_ARM_PC24 app_func2

View file

@ -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