1#source: dso-4.s
2#source: dso-2b.s
3#source: dso-1c.s
4#as: --pic --no-underscore --em=criself -I$srcdir/$subdir
5#ld: --shared -m crislinux
6#readelf: -s -r
7
8# PR 16044 is about a (compile-time-non-local) hidden function symbol,
9# entered as an undef reference with a R_CRIS_32_PLT_GOTREL relocation
10# referring to a hidden symbol, later defined.  Here, we invalidly
11# incremented the h->plt.refcount (from -1) as part of that relocation
12# processing.  There are some PLTGOT relocations.  As there are no
13# circumstances requiring a PLT entry for this symbol, its PLT entry
14# can be eliminated and the PLTGOT relocations can be made to a static
15# element in the GOT, relocated with the absolute-to-relative
16# R_CRIS_RELATIVE relocation without symbol lookup.  As part of
17# eliminating unneeded PLT entries (and PLTGOT to "static" GOT
18# elimination), a later pass noticed the inconsistency through an
19# assert.
20#
21# The key points in this dump that may need future adjustments are the
22# single dynamic relocation, that the dsofn symbol it points to, is
23# local, its absence from the dynamic symbol table and that the
24# relocation and symbol values match.
25
26Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
27 Offset[ 	]+Info[ 	]+Type[ 	]+Sym\.Value  Sym\. Name \+ Addend
28[0-9a-f]+  0+[0-9a-f]+ R_CRIS_RELATIVE[ 	]+184
29
30Symbol table '\.dynsym' contains 7 entries:
31 +Num: +Value +Size +Type +Bind +Vis +Ndx +Name
32 +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND
33 +1: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +5
34 +2: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +5 export_1
35 +3: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +7 __bss_start
36 +4: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +7 _edata
37 +5: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +7 _end
38 +6: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +5 export_2
39
40Symbol table '\.symtab' contains [0-9]+ entries:
41#...
42 +[0-9]+: 0+184  +2 FUNC + LOCAL + DEFAULT + 5 dsofn
43#...
44