OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-src/binutils-2.18.50/ld/testsuite/ld-cris
    from Rev 38 to Rev 156
    Reverse comparison

Rev 38 → Rev 156

/v32-bin-1.s
0,0 → 1,7
x:
lapc 0x2000,r5
bsr 0x8000
nop
lapc ext1,r3
bsr ext2
nop
/gotrel2.s
0,0 → 1,5
.text
.weak undefweak
.global _start
_start:
move.d [$r0+undefweak:GOT],$r3
/dsov32-1.s
0,0 → 1,8
.text
.global dsofn3
.type dsofn3,@function
dsofn3:
bsr dsofn:PLT
nop
.Lfe1:
.size dsofn3,.Lfe1-dsofn3
/euwref1.s
0,0 → 1,8
.text
y:
.weak uw1
.weak uw2
.weak uw3
move.d uw1,$r10
move.d uw2:GOT,$r10
move.d uw3:PLT,$r10
/libdso-14.d
0,0 → 1,19
#source: dso-1.s
#source: dsov32-4.s
#as: --pic --no-underscore --march=v32 --em=criself
#ld: --shared -m crislinux
#readelf: -d -r
 
# Checking that a bsr to a non-PLT-decorated nonvisible function
# doesn't make the DSO textrel.
 
Dynamic section at offset 0x16c contains 6 entries:
Tag[ ]+Type[ ]+Name/Value
0x0+4 \(HASH\)[ ]+0x94
0x0+5 \(STRTAB\)[ ]+0x134
0x0+6 \(SYMTAB\)[ ]+0xc4
0x0+a \(STRSZ\)[ ]+38 \(bytes\)
0x0+b \(SYMENT\)[ ]+16 \(bytes\)
0x0+ \(NULL\)[ ]+0x0
 
There are no relocations in this file.
/dsov32-3.s
0,0 → 1,8
.text
.global dsofn5
.type dsofn5,@function
dsofn5:
bsr dsofn
nop
.Lfe1:
.size dsofn5,.Lfe1-dsofn5
/noov.s
0,0 → 1,14
.text
; Test that this works both with a symbol defined in a section...
.dword __Edata+0x40000000
 
; ...as well as absolute symbol (defined outside sections in the
; linker script).
.dword __Sdata+0x40000000
 
.data
; Make sure we get the same section alignment for *-elf as for *-linux*.
.balign 0x2000
 
; Make .data non-empty.
.dword 0
/dso-1.s
0,0 → 1,8
.text
.global dsofn
.type dsofn,@function
.p2align 1
dsofn:
nop
.Lfe:
.size dsofn,.Lfe1-dsofn
/globsymw2.s
0,0 → 1,16
.text
.stabn 162,0,0,0
;# A bit like globsymw1.s but containing a valid, working, stabs
;# symbol warning construct.
.stabs "isatty is not implemented and will always fail",30,0,0,0
.stabs "globsym1",1,0,0,0
.global globsym1
.type globsym1, @function
globsym1:
.stabd 46,0,0
.stabn 68,0,16,LM0-globsym1
LM0:
.long 0
.size globsym1, .-globsym1
.stabs "",100,0,0,Letext0
Letext0:
/dso-3.s
0,0 → 1,20
; The visibility definitions here override the default
; definitions in the object where the symbols are defined. We
; check STV_HIDDEN and STV_PROTECTED with function and object
; definition respectively. This is by no means a full coverage,
; just enough to be a test-case for the bug described in
; libdso-3.d. Use ld-elfvsb for general visibility tests.
 
.hidden expobj
.protected expfn
 
.text
.global globsym
.type globsym,@function
globsym:
move.d expfn:GOTOFF,$r3
move.d expfn:PLTG,$r3
move.d expfn:PLT,$r3
move.d expobj:GOTOFF,$r3
.Lfe1:
.size globsym,.Lfe1-globsym
/warn1.d
0,0 → 1,11
#source: start1.s
#source: globsym1ref.s
#source: globsymw1.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=crisaout
#ld: -mcrisaout
#objdump: -p
# There should be no warning, since the symbol warned about is
# missing from the construct.
.*: file format a\.out-cris
#pass
/v32-ba-1.d
0,0 → 1,20
# notarget: cris*-*-linux-gnu
# as: --march=v32 --em=criself
# ld: -m criself
# objdump: -d
 
# Check that 32-bit branches (PCREL:s) are relocated right.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
.*: file format elf32-us-cris
 
Disassembly of section \.text:
 
0+ <(a|__Stext)>:
0: bf0e 0800 0000 ba 8 <b>
6: 5e82 moveq 30,r8
 
0+8 <b>:
8: 4312 moveq 3,r1
a: bf0e f6ff ffff ba 0 <[^>]*>
10: 4db2 moveq 13,r11
/expdyn1.d
0,0 → 1,14
#source: expdyn1.s
#as: --no-underscore --em=criself
#ld: -m crislinux -export-dynamic tmpdir/libdso-1.so
#objdump: -T
 
.*: file format elf32-cris
 
# Exporting dynamic symbols means objects as well as functions.
 
DYNAMIC SYMBOL TABLE:
#...
00080... g DF .text 0+2 expfn
00082... g DO .data 0+4 expobj
#pass
/warn3.d
0,0 → 1,10
#source: start1.s
#source: globsym1ref.s
#source: globsymw2.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=crisaout
#ld: -mcrisaout
#warning: warning: isatty is not implemented and will always fail$
#objdump: -p
.*: file format a\.out-cris
#pass
/expdyn3.d
0,0 → 1,12
#source: expdyn1.s
#source: expdref1.s --pic
#source: euwref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -R
 
# Like expdyn2.d, but also weakly referencing symbols.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS \(none\)
/locref1.d
0,0 → 1,22
#as: --no-underscore --pic --em=criself
#source: expdyn1.s
#source: locref1.s
#ld: -m crislinux
#objdump: -dt
 
# Referencing a "normal" (non-hidden) symbol with a local-only PIC
# relocation is ok when building an executable.
 
.*: file format elf32-cris
 
SYMBOL TABLE:
#...
0+82084 l O \.got 0+ \.hidden _GLOBAL_OFFSET_TABLE_
0+80076 g F \.text 0+2 expfn
0+82090 g O \.data 0+4 expobj
#...
Disassembly of section \.text:
#...
0+80078 <y>:
80078: 6fae f2df ffff .*
8007e: 6fbe 0c00 0000 .*
/expdyn5.d
0,0 → 1,13
#source: expdyn1.s
#source: expdref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -s -j .got
 
# Like expdyn2.d, but testing that the .got contents is correct. There
# needs to be a .got due to the GOT relocs, but the entry is constant.
 
.*: file format elf32-cris
Contents of section \.got:
82244 dc210800 00000000 00000000 bf010800 .*
82254 58220800 .*
/expdyn7.d
0,0 → 1,13
#source: expdyn1.s
#source: expdref1.s --pic
#source: comref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -s -j .got
 
# Like expdyn5.d, referencing COMMON symbols.
 
.*: file format elf32-cris
Contents of section \.got:
8229c 34220800 00000000 00000000 b8220800 .*
822ac 04020800 b4220800 .*
/weakref1.d
0,0 → 1,17
#source: gotrel2.s
#as: --pic --no-underscore --em=criself
#ld: -m crislinux tmpdir/libdso-1.so
#objdump: -R
 
# A dynamic reloc for an undefined weak reference in a program got a
# confused symbol reference count mismatch with a bfd assertion. Linking
# with a DSO was needed as a catalyst to get to the faulty code; nothing
# in the DSO was needed. We just check that we don't get the bfd
# assertion. Note that no actual dynamic reloc is created for the
# unresolved weak. Perhaps it should; the symbol could be defined in a
# preloaded object or a new version of the DSO. FIXME: Revisit and adjust
# test-result.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS \(none\)
/expdyn1.s
0,0 → 1,18
.data
.global expobj
.type expobj,@object
.size expobj,4
expobj:
.dword 0
 
.text
.global _start
_start:
nop
.global expfn
expfn:
.type expfn,@function
nop
.Lfe1:
.size expfn,.Lfe1-expfn
 
/v32-ba-1.s
0,0 → 1,11
.global a
a:
ba b
moveq 30,r8
 
.section .text.2,"ax"
.global b
b:
moveq 3,r1
ba a
moveq 13,r11
/ldsym1.d
0,0 → 1,20
# source: expdyn1.s
# target: cris-*-*elf* cris-*-*aout*
# as: --em=criself
# ld: -mcriself
# objdump: -d
 
# Note that the linker script symbol __start is set to the same
# value as _start, and will collate before _start and be chosen
# as the presentation symbol at disassembly. Anyway, __start
# shouldn't hinder disassembly by posing as an object symbol.
 
.*: file format elf32-us-cris
 
Disassembly of section \.text:
 
0+ <(___init__start|__start|__Stext)>:
0: 0f05 nop
 
0+2 <expfn>:
2: 0f05 nop
/locref1.s
0,0 → 1,3
y:
move.d expfn:GOTOFF,$r10
move.d expobj:GOTOFF,$r11
/v10-va.d
0,0 → 1,14
# notarget: cris*-*-linux-gnu
# source: start1.s --march=common_v10_v32
# source: move-1.s --march=v0_v10
# as: --em=criself
# ld: -m criself
# objdump: -p
 
# Test that linking a v10 compatible object to a v10+v32 object
# does work and results in the output marked as a v10 object.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
#...
private flags = 1: \[symbols have a _ prefix\]
#pass
/va-v10.d
0,0 → 1,14
# notarget: cris*-*-linux-gnu
# source: start1.s --march=v0_v10
# source: move-1.s --march=common_v10_v32
# as: --em=criself
# ld: -m criself
# objdump: -p
 
# Test that linking a v10+v32 compatible object to a v10 object
# does work and results in the output marked as a v10 object.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
#...
private flags = 1: \[symbols have a _ prefix\]
#pass
/libdso-2.d
0,0 → 1,58
#source: dso-1.s
#source: dso-2.s
#as: --pic --no-underscore --em=criself
#ld: --shared -m crislinux --version-script $srcdir/$subdir/hide1
#readelf: -S -s -r
 
# Use "dsofn" from dso-1 in a GOTPLT reloc, but hide it in a
# version script. This will change the incoming GOTPLT reloc to
# instead be a (local) GOT reloc. There are no other .rela.got
# entries. This formerly SEGV:ed because .rela.got was created
# too late to have it mapped to an output section.
 
There are 13 section headers.*
#...
\[ 1\] \.hash HASH .*
\[ 2\] \.dynsym DYNSYM .*
\[ 3\] \.dynstr STRTAB .*
\[ 4\] \.gnu\.version VERSYM .*
\[ 5\] \.gnu\.version_d VERDEF .*
\[ 6\] \.rela\.dyn RELA .*
\[ 7\] \.text PROGBITS .*
\[ 8\] \.dynamic DYNAMIC .*
\[ 9\] \.got PROGBITS .*
\[10\] \.shstrtab STRTAB .*
\[11\] \.symtab SYMTAB .*
\[12\] \.strtab STRTAB .*
#...
Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
#...
00002[12][0-9a-f][048c] 0000000c R_CRIS_RELATIVE 00000150
#...
Symbol table '\.dynsym' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0+ 0 NOTYPE LOCAL DEFAULT UND
1: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 7
2: 0+ 0 OBJECT GLOBAL DEFAULT ABS TST1
3: 0+154 0 FUNC GLOBAL DEFAULT 7 export_1@@TST1
 
Symbol table '\.symtab' contains 18 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0+ 0 NOTYPE LOCAL DEFAULT UND
1: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 1
2: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 2
3: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 3
4: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 4
5: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 5
6: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 6
7: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 7
8: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 8
9: [0-9a-f]+ 0 SECTION LOCAL DEFAULT 9
10: 0+2..[046c] 0 OBJECT LOCAL HIDDEN ABS _DYNAMIC
11: 0+2..[046c] 0 NOTYPE LOCAL DEFAULT ABS __bss_start
12: 0+2..[046c] 0 NOTYPE LOCAL DEFAULT ABS _edata
13: 0+2..[046c] 0 OBJECT LOCAL HIDDEN ABS _GLOBAL_OFFSET_TABLE_
14: 0+2..[046c] 0 NOTYPE LOCAL DEFAULT ABS _end
15: 0+150 0 FUNC LOCAL DEFAULT 7 dsofn
16: 0+ 0 OBJECT GLOBAL DEFAULT ABS TST1
17: 0+154 0 FUNC GLOBAL DEFAULT 7 export_1
/comref1.s
0,0 → 1,8
.text
y:
.comm c1,4,1
.comm c2,4,1
.comm c3,4,1
move.d c1,$r10
move.d c2:GOT,$r10
move.d c3:PLT,$r10
/nodyn5.d
0,0 → 1,13
#source: expdyn1.s
#source: expdref1.s --pic
#source: comref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux
#objdump: -s -j .got
 
# Like nodyn4.d, but checking .got contents.
 
.*: file format elf32-cris
Contents of section \.got:
820a4 00000000 00000000 00000000 c0200800 .*
820b4 76000800 bc200800 .*
/libdso-4.d
0,0 → 1,11
#source: dso-2.s
#as: --pic --no-underscore --em=criself
#ld: --shared -m crislinux
#objdump: -T
 
# DSO with an undef symbol "dsofn". See undef1.d.
 
.*: file format elf32-cris
#...
0+ D \*UND\* 0+ dsofn
 
/def3.d
0,0 → 1,10
#source: start1.s
#source: stabs1.s
#source: globsymw1.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=criself
#ld: -mcriself
#objdump: -p
# Just checking that undef3 links correctly when given a symbol.
.*: file format elf32.*-cris
#pass
/undef2.d
0,0 → 1,6
# source: start1.s
# source: stabs1.s
# target: cris-*-*elf* cris-*-*aout*
# as: --em=crisaout
# ld: -mcrisaout
# error: .o:/blah/foo.c:96: undefined reference to `globsym1'$
/gotplt2.d
0,0 → 1,37
#source: dso-2.s
#source: dsofnf.s
#source: gotrel1.s
#as: --pic --no-underscore --em=criself
#ld: -shared -m crislinux -z nocombreloc
#objdump: -sR
 
# Make sure we merge a PLT-specific entry (usually
# R_CRIS_JUMP_SLOT) with a GOT-specific entry (R_CRIS_GLOB_DAT)
# in a DSO. It's ok: we make a round-trip to the PLT in the
# executable if it's referenced there, but that's still
# perceived as better than having an unnecessary PLT, dynamic
# reloc and lookup in the DSO.)
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
00002230 R_CRIS_GLOB_DAT dsofn
 
Contents of section .*
#...
Contents of section \.rela\.got:
0188 30220000 0a080000 00000000 .*
Contents of section \.text:
0194 5f1d0c00 30096f1d 0c000000 30090000 .*
01a4 6f0d0c00 0000611a 6f3e88df ffff0000 .*
Contents of section \.dynamic:
21b4 04000000 94000000 05000000 5c010000 .*
21c4 06000000 cc000000 0a000000 2a000000 .*
21d4 0b000000 10000000 07000000 88010000 .*
21e4 08000000 0c000000 09000000 0c000000 .*
21f4 00000000 00000000 00000000 00000000 .*
2204 00000000 00000000 00000000 00000000 .*
2214 00000000 00000000 00000000 00000000 .*
Contents of section \.got:
2224 b4210000 00000000 00000000 00000000 .*
/libdso-11.d
0,0 → 1,27
#source: dso-1.s
#source: dsov32-1.s
#as: --pic --no-underscore --march=v32 --em=criself
#ld: --shared -m crislinux
#objdump: -s -T
 
.*: file format elf32-cris
 
DYNAMIC SYMBOL TABLE:
#...
0+1a0 g DF \.text 0+8 dsofn3
#...
0+19c g DF \.text 0+ dsofn
#...
Contents of section \.rela\.plt:
015c 2c220000 0b060000 00000000 .*
Contents of section \.plt:
0168 84e20401 7e7a3f7a 04f26ffa bf09b005 .*
0178 00000000 00000000 00006f0d 0c000000 .*
0188 6ffabf09 b0053f7e 00000000 bf0ed4ff .*
0198 ffffb005 .*
Contents of section \.text:
019c b0050000 bfbee2ff ffffb005 .*
Contents of section \.dynamic:
#...
Contents of section \.got:
2220 a8210000 00000000 00000000 8e010000 .*
/gotrel1.s
0,0 → 1,4
.global _start
_start:
localsym:
move.d localsym:GOTOFF,$r3
/libdso-13.d
0,0 → 1,30
#source: dso-1.s
#source: dsov32-3.s
#as: --pic --no-underscore --march=v32 --em=criself
#ld: --shared -m crislinux -z nocombreloc
#readelf: -d -r
#warning: relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC
 
# Check that a TEXTREL reloc is correctly generated for PCREL
# relocations against global symbols.
# FIXME: Have a textrel-enabling(-disabling) linker option.
# (Warning always generated unless [other option] warnings are
# generally disabled.) Split out the expected readelf output
# into a separate test using that option.
 
Dynamic section at offset 0x[0-9a-f][0-9a-f][0-9a-f] contains 10 entries:
Tag[ ]+Type[ ]+Name/Value
0x0+4 \(HASH\)[ ]+0x94
0x0+5 \(STRTAB\)[ ]+0x[12][0-9a-f][0-9a-f]
0x0+6 \(SYMTAB\)[ ]+0x[0-9a-f][0-9a-f]
0x0+a \(STRSZ\)[ ]+38 \(bytes\)
0x0+b \(SYMENT\)[ ]+16 \(bytes\)
0x0+7 \(RELA\)[ ]+0x[12][0-9a-f][0-9a-f]
0x0+8 \(RELASZ\)[ ]+12 \(bytes\)
0x0+9 \(RELAENT\)[ ]+12 \(bytes\)
0x0+16 \(TEXTREL\)[ ]+0x0
0x0+ \(NULL\)[ ]+0x0
 
Relocation section '\.rela\.text' at offset 0x[12][0-9a-f][0-9a-f] contains 1 entries:
Offset[ ]+Info[ ]+Type[ ]+Sym\.Value Sym\. Name \+ Addend
0+[12][0-9a-f][0-9a-f] 0+[0-9a-f]06 R_CRIS_32_PCREL[ ]+0+[0-f]+[ ]+dsofn \+ 6
/start1.s
0,0 → 1,5
.global _start
_start:
; This must be compilable with --march=common_v10_v32.
moveq 1,r11
 
/dsofnf.s
0,0 → 1,7
.text
.global f
.type f,@function
f:
move.d [$r0+dsofn:GOT],$r1
0:
.size f,0b-f
/dsov32-2.s
0,0 → 1,10
.text
.global dsofn4
.type dsofn4,@function
dsofn4:
lapc _GLOBAL_OFFSET_TABLE_,$r0
addo.w expobj:GOT16,$r0,$acr
bsr dsofn4:PLT
nop
.Lfe1:
.size dsofn4,.Lfe1-dsofn4
/dsov32-4.s
0,0 → 1,14
.text
.global dsofn5
.type dsofn5,@function
dsofn5:
bsr localfn
nop
.Lfe:
.size dsofn5,.Lfe-dsofn5
 
.type localfn,@function
localfn:
nop
.Lfe1:
.size localfn,.Lfe1-localfn
/globsymw1.s
0,0 → 1,15
.text
.stabn 162,0,0,0
.global globsym1
.type globsym1, @function
globsym1:
.stabd 46,0,0
.stabn 68,0,16,LM0-globsym1
LM0:
.long 0
.size globsym1, .-globsym1
.stabs "",100,0,0,Letext0
Letext0:
;# This must be the last line; the point is that the warning symbol
;# construct is last, but is missing the actual symbol warned about.
.stabs "isatty is not implemented and will always fail",30,0,0,0
/badgotr1.d
0,0 → 1,11
#source: gotrel1.s
#as: --pic --underscore --em=criself
#ld: -m crislinux -shared
#objdump: -dr
#error: ^[^c][^h][^i][^l][^d].* uses _-prefixed .* failed to merge .* no GOT .* Bad value$
 
# The error regex above is supposed to not match if we get a
# SEGV, in which case we'll see "child killed: segmentation
# violation", supposedly at the beginning (seen) or end (in
# theory) of it. The input ELF type (with underscores on
# symbols) mismatches the output type (no underscores).
/dso-2.s
0,0 → 1,6
.text
.global export_1
.type export_1,@function
export_1:
jump [$r1+dsofn:GOTPLT16]
jump [$r1+dsofn:GOTPLT]
/hiddef1.d
0,0 → 1,28
#source: gotrel1.s
#source: hiddef1.s
#source: hidrefgotplt1.s
#ld: -shared -m crislinux
#as: --pic --no-underscore -I$srcdir/$subdir --em=criself
#readelf: -S -s -r
 
# Regression test for mishandling of GOTPLT relocs against a
# hidden symbol, where the reloc is found after the symbol
# definition. There should be no PLT, just a single GOT entry
# from a GOTPLT reloc moved to the .got section. It's hard to
# check for absence of a .plt section, so we just check the
# number of symbols and sections. When the number of symbols
# and sections change, make sure that there's no .plt and that
# dsofn is hidden (not exported as a dynamic symbol).
 
There are 11 section headers, starting at offset 0x[0-9a-f]+:
#...
\[[ 0-9]+\] \.got PROGBITS [0-9a-f]+ [0-9a-f]+ 0+10 04 WA 0 0 4
#...
Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
#...
[0-9a-f]+ 0+c R_CRIS_RELATIVE [0-9a-f]+
#...
Symbol table '\.dynsym' contains 6 entries:
#...
Symbol table '\.symtab' contains 16 entries:
#pass
/hide1
0,0 → 1,28
TST1 { global: export_*; local: *; };
/pv32.s
0,0 → 1,24
.global here
.type here,@function
here:
nop
.Lfe3:
.size here,.Lfe3-dsofn
 
.type pfn,@function
pfn:
bsr expfn
nop
bsr dsofn3
nop
.Lfe1:
.size pfn,.Lfe1-pfn
 
.global dsofn
.type dsofn,@function
dsofn:
move.d expobj,$r10
nop
.Lfe2:
.size dsofn,.Lfe2-dsofn
 
/stabs1.s
0,0 → 1,26
.stabs "/x/y/z/",100,0,2,Ltext0
.stabs "/blah/foo.c",100,0,2,Ltext0
.text
Ltext0:
.global _xyzzy
.type _xyzzy, @function
_xyzzy:
.stabd 46,0,0
.stabn 68,0,95,LM16-_xyzzy
LM16:
.long 0
.stabn 68,0,96,LM17-_xyzzy
LM17:
.long globsym1
.stabn 68,0,88,LM25-_xyzzy
LM25:
.long 0
.size _xyzzy, .-_xyzzy
.stabn 192,0,0,_xyzzy-_xyzzy
.stabn 224,0,0,Lscope0-_xyzzy
Lscope0:
;# This is the stabs construct that was barfed upon; BFD for
;# a.out expects it to be of two parts, like the construct at
;# the top of this file.
.stabs "",100,0,0,Letext0
Letext0:
/v32-v10.d
0,0 → 1,10
# notarget: cris*-*-linux-gnu
# source: start1.s --march=v0_v10
# source: move-1.s --march=v32
# as: --em=criself
# ld: -m criself
# error: contains CRIS v32 code
 
# Test that linking a v32 object to a (classic) v10 object does
# not work.
# Source code and "-m criself" doesn't work with *-linux-gnu.
/v10-v32.d
0,0 → 1,10
# notarget: cris*-*-linux-gnu
# source: start1.s --march=v32
# source: move-1.s --march=v0_v10
# as: --em=criself
# ld: -m criself
# error: contains non-CRIS-v32 code
 
# Test that linking a (classic) v10 object to a v32 object does
# not work. Source code and "-m criself" doesn't work with *-linux-gnu.
 
/hiddef1.s
0,0 → 1,2
.include "dso-1.s"
.hidden dsofn
/warn2.d
0,0 → 1,11
#source: start1.s
#source: globsym1ref.s
#source: globsymw1.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=criself
#ld: -mcriself
#objdump: -p
# There should be no warning, since the symbol warned about is
# missing from the construct.
.*: file format elf32.*-cris
#pass
/expdyn2.d
0,0 → 1,16
#source: expdyn1.s
#source: expdref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -R
 
# Programs linked with --export-dynamic threw away .rela.got for exported
# symbols, but since got reference counter wasn't reset, there was a SEGV
# trying to generate the .rela.got relocations. In this test, we have an
# object in the program that has pic-relocations to an exported symbol,
# but those relocations can be resolved at link-time. We link to a DSO to
# get dynamic linking.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS \(none\)
/warn4.d
0,0 → 1,13
#source: start1.s
#source: globsym1ref.s
#source: globsymw2.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=criself
#ld: -mcriself
#warning: warning: isatty is not implemented and will always fail$
#objdump: -p
#xfail: *-*-*
# The test is xfailed because ELF stabs doesn't handle the stabs
# warning construct.
.*: file format elf32.*-cris
#pass
/expdyn4.d
0,0 → 1,12
#source: expdyn1.s
#source: expdref1.s --pic
#source: comref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -R
 
# Like expdyn2.d, but referencing COMMON symbols.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS \(none\)
/hidrefgotplt1.s
0,0 → 1,2
.text
move.d [$r0+dsofn:GOTPLT],$r1
/locref2.d
0,0 → 1,22
#as: --no-underscore --pic --em=criself
#source: gotrel1.s
#source: locref2.s
#ld: -m crislinux
#objdump: -dt
 
# Referencing an undefined weak (non-hidden) symbol with a local-only
# PIC relocation is ok when building an executable.
 
.*: file format elf32-cris
 
SYMBOL TABLE:
#...
0+82088 l O \.got 0+ \.hidden _GLOBAL_OFFSET_TABLE_
0+ w \*UND\* 0+ expfn
0+ w \*UND\* 0+ expobj
#...
Disassembly of section \.text:
#...
0+8007c <y>:
8007c: 6fae 78df f7ff .*
80082: 6fbe 78df f7ff .*
/expdyn6.d
0,0 → 1,13
#source: expdyn1.s
#source: expdref1.s --pic
#source: euwref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux --export-dynamic tmpdir/libdso-1.so
#objdump: -s -j .got
 
# Like expdyn5.d, weakly referencing symbols.
 
.*: file format elf32-cris
Contents of section \.got:
822a0 38220800 00000000 00000000 00000000 .*
822b0 07020800 b8220800 .*
/expdref1.s
0,0 → 1,6
.text
x:
move.d expobj:GOT,$r10
move.d expobj:PLT,$r10
move.d expfn:GOT,$r10
move.d expfn:PLT,$r10
/noglob1.d
0,0 → 1,9
#ld:
#target: cris-*-*elf* cris-*-*aout*
#objdump: -p
 
# Check that we can link an object that doesn't have any global symbols;
# where elf_sym_hashes(bfd) is NULL.
 
.*: file format .*-cris
#pass
/weakref2.d
0,0 → 1,10
#source: gotrel2.s
#as: --pic --no-underscore --em=criself
#ld: -m crislinux tmpdir/libdso-1.so
#objdump: -s -j .got
 
# Like weakref1.d, but check contents of .got.
 
.*: file format elf32-cris
Contents of section \.got:
821e4 7c210800 00000000 00000000 00000000 .*
/globsym1ref.s
0,0 → 1,10
.long globsym1
/cris.exp
0,0 → 1,58
# Expect script for ld-cris tests
# Copyright 2002, 2007 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Written by Hans-Peter Nilsson (hp@axis.com)
#
 
if ![istarget cris-*-*] {
return
}
 
set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 
# First, execute those tests that are named to indicate that they create a
# DSO. Copy the file from the run_dump_test "tmpdir/dump" to a unique
# expected name.
# FIXME: Add option "output: filename" to run_dump_test.
# FIXME: Add option "ldtail: option" to run_dump_test, so we can link
# libraries in the right order.
foreach atest $rd_test_list {
# We need to check against runtest_file_p too, or we'd mindlessly copy
# the last tmpdir/dump in selective test-runs.
if { [string match $srcdir/$subdir/*dso-*.d $atest] \
&& [runtest_file_p $runtests [file tail $atest]] } {
verbose [file rootname $atest]
run_dump_test [file rootname $atest]
set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $atest]].so"
send_log "$cmd\n"
set cmdret [catch "exec $cmd" comp_output]
send_log "$comp_output\n"
# FIXME: What if it fails? Need we do something?
}
}
 
# Then run the ordinary tests. This round, exclude the dso-* tests.
foreach atest $rd_test_list {
# We need to strip the ".d", but can leave the dirname.
if { ! [string match $srcdir/$subdir/*dso-*.d $atest] } {
verbose [file rootname $atest]
run_dump_test [file rootname $atest]
}
}
/libdso-1.d
0,0 → 1,13
#source: dso-1.s
#as: --pic --no-underscore --em=criself
#ld: --shared -m crislinux
#objdump: -T
 
# Just check that we actually got a DSO with the dsofn symbol.
 
.*: file format elf32-cris
 
DYNAMIC SYMBOL TABLE:
#...
00000[12].[02468ace] g DF .text 00000000 dsofn
#pass
/locref2.s
0,0 → 1,5
.weak expfn
.weak expobj
y:
move.d expfn:GOTOFF,$r10
move.d expobj:GOTOFF,$r11
/nodyn4.d
0,0 → 1,19
#source: expdyn1.s
#source: expdref1.s --pic
#source: comref1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux
#readelf: -l
 
# Like expdyn4.d, but no --export-dynamic. Got a BFD_ASSERT at one time.
# Check that we get the expected sections.
 
#...
There are 2 program headers, .*
#...
LOAD [0-9a-fx ]+ R E 0x2000
LOAD [0-9a-fx ]+ RW 0x2000
#...
00 \.text[ ]*
01 \.got \.data \.bss[ ]*
#pass
/libdso-3.d
0,0 → 1,14
#source: expdyn1.s
#source: dso-3.s
#as: --pic --no-underscore --em=criself
#ld: --shared -m crislinux
#objdump: -R
 
# GOTOFF relocs against global symbols with non-default
# visibility got a linker error. (A non-default visibility is
# to be treated as a local definition for the reloc.) We also
# make sure we don't get unnecessary dynamic relocations.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS \(none\)
/v32-bin-1.d
0,0 → 1,13
#notarget: cris*-*-linux-gnu
#as: --em=criself --march=v32
#ld: -m criself --oformat binary --defsym ext1=0x4000 --defsym ext2=0x6000
#objdump: -s -b binary
 
# Test that pcrel relocs work with --oformat binary.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
.*: file format binary
 
Contents of section \.data:
0000 7f5d0020 0000bfbe fa7f0000 b0057f3d .*
0010 f23f0000 bfbeec5f 0000b005 .*
/v32-va.d
0,0 → 1,14
# notarget: cris*-*-linux-gnu
# source: start1.s --march=common_v10_v32
# source: move-1.s --march=v32
# as: --em=criself
# ld: -m criself
# objdump: -p
 
# Test that linking a v32 object to a v10+v32 object
# does work and results in the output marked as a v32 object.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
#...
private flags = 3: \[symbols have a _ prefix\] \[v32\]
#pass
/va-v32.d
0,0 → 1,14
# notarget: cris*-*-linux-gnu
# source: start1.s --march=v32
# source: move-1.s --march=common_v10_v32
# as: --em=criself
# ld: -m criself
# objdump: -p
 
# Test that linking a v10+v32 compatible object to a v32 object
# does work and results in the output marked as a v32 object.
# Source code and "-m criself" doesn't work with *-linux-gnu.
 
#...
private flags = 3: \[symbols have a _ prefix\] \[v32\]
#pass
/noglob1.s
0,0 → 1,4
; See noglob1.d
.text
x:
move.d .,$r0
/dsofnf2.s
0,0 → 1,8
.text
.global f
.type f,@function
f:
move.d [$r0+dsofn:GOT],$r1
move.d dsofn,$r2
0:
.size f,0b-f
/def2.d
0,0 → 1,10
#source: start1.s
#source: stabs1.s
#source: globsymw1.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=crisaout
#ld: -mcrisaout
#objdump: -p
# Just checking that undef2 links correctly when given a symbol.
.*: file format a\.out-cris
#pass
/noov.d
0,0 → 1,13
#target: cris-*-*elf*
#ld: --section-start=.text=0xc0010000
#objdump: -s -j .text
 
# Check that we don't get a "relocation truncated to fit", when a
# relocation would overflow if it hadn't been wrapping. We always
# want 32-bit-wrapping on a 32-bit target for the benefit of Linux
# address-mapping macros.
 
.*: file format elf32.*-cris
 
Contents of section \.text:
c0010000 04200100 00200100 .*
/undef1.d
0,0 → 1,13
#source: dso-1.s
#source: gotrel1.s --pic
#as: --no-underscore --em=criself
#ld: -m crislinux tmpdir/libdso-4.so
#objdump: -T
 
# The DSO used has an undef reference to the symbol "dsofn", which is
# supposed to cause the program to automatically export it as a dynamic
# symbol; no --export-dynamic is supposed to be needed.
 
#...
[0-9a-f]+ g DF .text 00000000 dsofn
#pass
/move-1.s
0,0 → 1,3
.text
localsym:
moveq 1,$r10
/undef3.d
0,0 → 1,6
#source: start1.s
#source: stabs1.s
#target: cris-*-*elf* cris-*-*aout*
#as: --em=criself
#ld: -mcriself
#error: .o:/blah/foo.c:96: undefined reference to `globsym1'$
/pv32-1.d
0,0 → 1,40
#source: pv32.s
#as: --march=v32 --no-underscore --em=criself
#ld: -e here -m crislinux tmpdir/libdso-12.so
#objdump: -s -T
 
# Trivial test of linking a program to a v32 DSO.
 
.*: file format elf32-cris
 
DYNAMIC SYMBOL TABLE:
0+8021e DF \*UND\* 0+2 expfn
0+82324 g DO \.bss 0+4 expobj
0+82324 g D \*ABS\* 0+ __bss_start
0+80238 DF \*UND\* 0+8 dsofn3
0+82324 g D \*ABS\* 0+ _edata
0+82340 g D \*ABS\* 0+ _end
0+80264 g DF \.text 0+8 dsofn
 
Contents of section \.interp:
800d4 2f6c6962 2f6c642e 736f2e31 00 .*
#...
Contents of section \.rela\.dyn:
801e0 24230800 09020000 00000000 .*
Contents of section \.rela\.plt:
801ec 1c230800 0b010000 00000000 20230800 .*
801fc 0b040000 00000000 .*
Contents of section \.plt:
80204 84e26ffe 14230800 7e7a3f7a 04f26ffa .*
80214 bf09b005 00000000 00006ffe 1c230800 .*
80224 6ffabf09 b0053f7e 00000000 bf0ed4ff .*
80234 ffffb005 6ffe2023 08006ffa bf09b005 .*
80244 3f7e0c00 0000bf0e baffffff b005 .*
Contents of section \.text:
80252 b005bfbe caffffff b005bfbe dcffffff .*
80262 b0056fae 24230800 b0050000 .*
Contents of section \.dynamic:
#...
Contents of section \.got:
82310 70220800 00000000 00000000 2a020800 .*
82320 44020800 .*
/libdso-10.d
0,0 → 1,37
#source: dso-1.s
#as: --pic --no-underscore --march=v32 --em=criself
#ld: --shared -m crislinux
#objdump: -p -h
 
# Sanity check; just an empty GOT.
 
.*: file format elf32-cris
 
Program Header:
LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13
filesz 0x0+144 memsz 0x0+144 flags r-x
LOAD off 0x0+144 vaddr 0x0+2144 paddr 0x0+2144 align 2\*\*13
filesz 0x0+64 memsz 0x0+64 flags rw-
DYNAMIC off 0x0+144 vaddr 0x0+2144 paddr 0x0+2144 align 2\*\*2
filesz 0x0+58 memsz 0x0+58 flags rw-
Dynamic Section:
HASH.*0x0*94
STRTAB.*0x0*120
SYMTAB.*0x0*c0
STRSZ.*0x0*1f
SYMENT.*0x0*10
private flags = 2: \[v32\]
Sections:
Idx Name Size VMA LMA File off Algn
0 \.hash 0+2c 0+94 0+94 0+94 2\*\*2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 \.dynsym 0+60 0+c0 0+c0 0+c0 2\*\*2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 \.dynstr 0+1f 0+120 0+120 0+120 2\*\*0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 \.text 0+4 0+140 0+140 0+140 2\*\*1
CONTENTS, ALLOC, LOAD, READONLY, CODE
4 \.dynamic 0+58 0+2144 0+2144 0+144 2\*\*2
CONTENTS, ALLOC, LOAD, DATA
5 \.got 0+c 0+219c 0+219c 0+19c 2\*\*2
CONTENTS, ALLOC, LOAD, DATA
/gotplt1.d
0,0 → 1,48
#source: dso-2.s
#source: dsofnf2.s
#source: gotrel1.s
#as: --pic --no-underscore --em=criself
#ld: -m crislinux tmpdir/libdso-1.so
#objdump: -sR
 
# Make sure we don't merge a PLT-specific entry
# (R_CRIS_JUMP_SLOT) with a non-PLT-GOT-specific entry
# (R_CRIS_GLOB_DAT) in an executable, since they may have
# different contents there. (If we merge them in a DSO it's ok:
# we make a round-trip to the PLT in the executable if it's
# referenced there, but that's still perceived as better than
# having an unnecessary PLT, dynamic reloc and lookup in the
# DSO.) In the executable, the GOT contents for the non-PLT
# reloc should be constant.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
00082280 R_CRIS_JUMP_SLOT dsofn
 
Contents of section .*
#...
Contents of section \.rela\.plt:
80190 80220800 0b040000 00000000 .*
Contents of section \.plt:
8019c fce17e7e 7f0d7822 0800307a 7f0d7c22 .*
801ac 08003009 7f0d8022 08003009 3f7e0000 .*
801bc 00002ffe d8ffffff .*
Contents of section \.text:
801c4 5f1d0c00 30096f1d 0c000000 30090000 .*
801d4 6f0d1000 0000611a 6f2eb001 08000000 .*
801e4 6f3e70df ffff0000 .*
Contents of section \.dynamic:
821ec 01000000 01000000 04000000 e4000800 .*
821fc 05000000 5c010800 06000000 0c010800 .*
8220c 0a000000 32000000 0b000000 10000000 .*
8221c 15000000 00000000 03000000 74220800 .*
8222c 02000000 0c000000 14000000 07000000 .*
8223c 17000000 90010800 00000000 00000000 .*
8224c 00000000 00000000 00000000 00000000 .*
8225c 00000000 00000000 00000000 00000000 .*
8226c 00000000 00000000 .*
Contents of section \.got:
82274 ec210800 00000000 00000000 b8010800 .*
82284 b0010800 .*
/libdso-12.d
0,0 → 1,51
#source: expdyn1.s
#source: dsov32-1.s
#source: dsov32-2.s
#as: --pic --no-underscore --march=v32 --em=criself
#ld: --shared -m crislinux -z nocombreloc
#objdump: -s -T
 
# Check for common DSO contents; load of GOT register, branch to
# function PLT, undefined symbol, GOT reloc.
 
.*: file format elf32-cris
 
DYNAMIC SYMBOL TABLE:
#...
0+23e g DF \.text 0+12 dsofn4
0+234 g DF \.text 0+2 expfn
0+22fc g DO \.data 0+4 expobj
#...
0+236 g DF \.text 0+8 dsofn3
#...
0+ D \*UND\* 0+ dsofn
#...
Contents of section \.rela\.got:
01c0 f8220000 0a040000 00000000 .*
Contents of section \.rela\.plt:
01cc f0220000 0b020000 00000000 f4220000 .*
01dc 0b0a0000 00000000 .*
Contents of section \.plt:
01e4 84e20401 7e7a3f7a 04f26ffa bf09b005 .*
01f4 00000000 00000000 00006f0d 0c000000 .*
0204 6ffabf09 b0053f7e 00000000 bf0ed4ff .*
0214 ffffb005 6f0d1000 00006ffa bf09b005 .*
0224 3f7e0c00 0000bf0e baffffff b005 .*
Contents of section \.text:
0232 b005b005 bfbee2ff ffffb005 7f0da620 .*
0242 00005f0d 1400bfbe b6ffffff b0050000 .*
Contents of section \.dynamic:
2254 04000000 94000000 05000000 84010000 .*
2264 06000000 d4000000 0a000000 3a000000 .*
2274 0b000000 10000000 03000000 e4220000 .*
2284 02000000 18000000 14000000 07000000 .*
2294 17000000 cc010000 07000000 c0010000 .*
22a4 08000000 0c000000 09000000 0c000000 .*
22b4 00000000 00000000 00000000 00000000 .*
22c4 00000000 00000000 00000000 00000000 .*
22d4 00000000 00000000 00000000 00000000 .*
Contents of section \.got:
22e4 54220000 00000000 00000000 0a020000 .*
22f4 24020000 00000000 .*
Contents of section \.data:
22fc 00000000 .*
/gotplt3.d
0,0 → 1,35
#source: dso-2.s
#source: dsofnf.s
#source: gotrel1.s
#source: dso-1.s
#as: --pic --no-underscore --em=criself
#ld: -shared -m crislinux -z nocombreloc
#objdump: -sR
 
# Like gotplt2, but make sure we merge right when we have a
# definition of the function too.
 
.*: file format elf32-cris
 
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
00002234 R_CRIS_GLOB_DAT dsofn
 
Contents of section .*
#...
Contents of section \.rela\.got:
0188 34220000 0a080000 00000000 .*
Contents of section \.text:
0194 5f1d0c00 30096f1d 0c000000 30090000 .*
01a4 6f0d0c00 0000611a 6f3e84df ffff0000 .*
01b4 0f050000 .*
Contents of section \.dynamic:
21b8 04000000 94000000 05000000 5c010000 .*
21c8 06000000 cc000000 0a000000 2a000000 .*
21d8 0b000000 10000000 07000000 88010000 .*
21e8 08000000 0c000000 09000000 0c000000 .*
21f8 00000000 00000000 00000000 00000000 .*
2208 00000000 00000000 00000000 00000000 .*
2218 00000000 00000000 00000000 00000000 .*
Contents of section \.got:
2228 b8210000 00000000 00000000 00000000 .*

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.