2002-01-29 Chris Demetriou <cgd@broadcom.com>

* ld-mips-elf/emrelocs-eb.d: New file to test --embedded-relocs.
        * ld-mips-elf/emrelocs-el.d: Likewise.
        * ld-mips-elf/emrelocs1.s: Likewise.
        * ld-mips-elf/emrelocs2.s: Likewise.
        * ld-mips-elf/emrelocs.ld: Likewise.
        * ld-mips-elf/mips-elf.exp: Add the above to the list of tests.
This commit is contained in:
Chris Demetriou 2002-01-30 02:20:13 +00:00
parent 030d18fb6f
commit 38b566ae19
7 changed files with 132 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2002-01-29 Chris Demetriou <cgd@broadcom.com>
* ld-mips-elf/emrelocs-eb.d: New file to test --embedded-relocs.
* ld-mips-elf/emrelocs-el.d: Likewise.
* ld-mips-elf/emrelocs1.s: Likewise.
* ld-mips-elf/emrelocs2.s: Likewise.
* ld-mips-elf/emrelocs.ld: Likewise.
* ld-mips-elf/mips-elf.exp: Add the above to the list of tests.
2002-01-21 Hans-Peter Nilsson <hp@axis.com>
* ld-cris: New testsuite directory.

View file

@ -0,0 +1,25 @@
#name: MIPS 32-bit ELF embedded relocs (big endian)
#source: emrelocs1.s -EB
#source: emrelocs2.s -EB
#ld: -EB --embedded-relocs -T $srcdir/$subdir/emrelocs.ld
#objdump: -s
.*: file format elf.*mips.*
Contents of section \.text:
100000 00000000 00000001 00000000 00000000 .*
100010 00000000 00000000 00000003 00000000 .*
Contents of section \.data:
200000 00000000 00000002 00000000 00000000 .*
200010 00000000 00000000 00000004 00000000 .*
200020 00100004 00200004 00100018 00200018 .*
200030 00000000 00100004 00000000 00200004 .*
200040 00000000 00100018 00000000 00200018 .*
Contents of section \.rel\.sdata:
300000 00000020 2e746578 74000000 00000024 .*
300010 2e646174 61000000 00000028 2e746578 .*
300020 74000000 0000002c 2e646174 61000000 .*
300030 00000031 2e746578 74000000 00000039 .*
300040 2e646174 61000000 00000041 2e746578 .*
300050 74000000 00000049 2e646174 61000000 .*
#pass

View file

@ -0,0 +1,25 @@
#name: MIPS 32-bit ELF embedded relocs (little endian)
#source: emrelocs1.s -EL
#source: emrelocs2.s -EL
#ld: -EL --embedded-relocs -T $srcdir/$subdir/emrelocs.ld
#objdump: -s
.*: file format elf.*mips.*
Contents of section \.text:
100000 00000000 01000000 00000000 00000000 .*
100010 00000000 00000000 03000000 00000000 .*
Contents of section \.data:
200000 00000000 02000000 00000000 00000000 .*
200010 00000000 00000000 04000000 00000000 .*
200020 04001000 04002000 18001000 18002000 .*
200030 04001000 00000000 04002000 00000000 .*
200040 18001000 00000000 18002000 00000000 .*
Contents of section \.rel\.sdata:
300000 20000000 2e746578 74000000 24000000 .*
300010 2e646174 61000000 28000000 2e746578 .*
300020 74000000 2c000000 2e646174 61000000 .*
300030 31000000 2e746578 74000000 39000000 .*
300040 2e646174 61000000 41000000 2e746578 .*
300050 74000000 49000000 2e646174 61000000 .*
#pass

View file

@ -0,0 +1,16 @@
ENTRY(ext_fun)
SECTIONS
{
.text 0x00100000:
{
*(.text)
}
.data 0x00200000:
{
*(.sdata)
}
.rel.sdata 0x00300000:
{
*(.rel.sdata)
}
}

View file

@ -0,0 +1,23 @@
# emrelocs1.s: some external symbols to be used in relocations.
.text
.p2align 4
# Pad things so addresses which are used for relocations
# are non-zero. Zero simply isn't as much fun.
.word 0
.globl ext_fun
.ent ext_fun
ext_fun: .word 1
.end ext_fun
.sdata
.p2align 4
# Padding here, for same reason.
.word 0
.globl ext_var
ext_var: .word 2

View file

@ -0,0 +1,30 @@
# emrelocs2.s: local symbols and data which causes relocations.
.text
.p2align 4
.word 0, 0
.ent lcl_fun
lcl_fun: .word 3
.end lcl_fun
.sdata
.p2align 4
.word 0, 0
lcl_var: .word 4
.p2align 4
.word ext_fun
.word ext_var
.word lcl_fun
.word lcl_var
.dword ext_fun
.dword ext_var
.dword lcl_fun
.dword lcl_var

View file

@ -34,5 +34,9 @@ if { [istarget mips*-*-*] } then {
run_dump_test "empic2-fwd-1"
run_dump_test "empic2-rev-0"
run_dump_test "empic2-rev-1"
# Check generation of embedded relocs section.
run_dump_test "emrelocs-eb"
run_dump_test "emrelocs-el"
}
}