binutils-gdb/ld/testsuite/ld-elf
Alan Modra a288c27099 PR24511, nm should not mark symbols in .init_array as "t"
This patch restricts the section names matched in coff_section_type,
a function that translates section names to symbol type, and arranges
to translate section flags to symbol type before looking at names.
The latter change resulted in various test failures due to improper
section flags being used in tests, and by the plugin support, so fix
that too.

The new test fails on many ELF targets that lack .init/fini_array
in their scripts.  I've just xfailed those.  pru-elf oddly defines
__init_array_begin rather than __init_array_start.  I've left that
target as a FAIL, and pj-elf too which reports an error for undefined
weak symbols.

bfd/
	PR 24511
	* syms.c (coff_section_type): Only allow '.', '$' and numeric
	following the standard section names.
	(bfd_decode_symclass): Prioritize section flag tests in
	decode_section_type before name tests in coff_section_type.
	* plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section
	and fake_common_section using BFD_FAKE_SECTION.  Use "fake" as
	their names and choose standard .text section flags for
	fake_section.
ld/
	PR 24511
	* testsuite/ld-elf/pr14156a.d: Allow for .init/.fini being a
	data section on hppa64.
	* testsuite/ld-elf/pr14156b.d: Likewise.
	* testsuite/ld-scripts/pr18963.t: Map standard sections to set
	output section flags.
	* testsuite/ld-scripts/sane1.t: Likewise.
	* testsuite/ld-elf/init-fini-arrays.s: Reference __init_array_start
	and __fini_array_start.  Define __start et al.
	* testsuite/ld-elf/pr24511.d: New test.
2019-05-04 16:57:33 +09:30
..
attributes.d
attributes.ld
attributes.s
audit.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
audit.rd
begin.c
beginwarn.c
binutils.exp
changelma.d
changelma.lnk
changelma.s
check-ptr-eq.c
comm1.c
comm-data1.s
comm-data1.sd
comm-data2.ld
comm-data2.rd
comm-data2.s
comm-data2.sd
comm-data2.xd
comm-data2r.rd
comm-data2r.sd
comm-data2r.xd
comm-data3.sd
comm-data3a.s
comm-data3b.s
comm-data4.d
comm-data4.s
comm-data5.d
comm-data5.s
comm-data.exp
commonpage1.d
commonpage2.d
compress1-alt.s
compress1.s
compress1a.d
compress1b.d
compress1c.d
compress.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
compressed1a.d
compressed1b.d
compressed1c.d
compressed1d-alt.d
compressed1d.d
compressed1e.d
data1.c
data1.h
data2.c
del.cc
depaudit2.rd
depaudit.rd
discard1.d
discard1.s
discard2.d
discard2.s
discard3.d
discard.ld
dl1.c
dl1.list
dl1.out
dl1main.c
dl2.c
dl2.list
dl2a.list
dl2a.out
dl2b.out
dl2main.c
dl2xxx.c
dl2xxx.list
dl3.cc
dl3.list
dl3a.out
dl3b.out
dl3header.h
dl3main.cc
dl4.c
dl4.list
dl4a.out
dl4b.out
dl4main.c
dl4xxx.c
dl4xxx.list
dl5.cc
dl5.out
dl6.c
dl6a.out
dl6amain.c
dl6b.out
dl6bmain.c
dl6cmain.c
dl6dmain.c
dummy.c
dummy.s
dwarf1.c
dwarf1.h
dwarf1.out
dwarf1main.c
dwarf2.err
dwarf2a.c
dwarf2b.c
dwarf3.c
dwarf3.err
dwarf.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
dynamic1.d
dynamic1.ld
dynamic1.s
dynamic-1.c
dynamic-1.rd
dynamic-1.syms
dynbss1.c
dynsym1.d
eh1.d
eh1.s
eh1a.s
eh2.d
eh2a.s
eh3.d
eh3.s
eh3a.s
eh4.d
eh4.s
eh4a.s
eh5.d
eh5.s
eh5a.s
eh5b.s
eh6.d
eh6.s
eh-frame-hdr.d
eh-frame-hdr.s
eh-group1.s
eh-group2.s
eh-group.exp
ehdr_start-missing.d
ehdr_start-missing.t
ehdr_start-shared.d
ehdr_start-strongref.s
ehdr_start-userdef.d
ehdr_start-userdef.t
ehdr_start-weak.d
ehdr_start.d
ehdr_start.s
elf.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
empty2.d
empty2.s
empty-implib.out
empty.d
empty.s
end.c
endhidden.c
endprotected.c
endsym.d
endsym.s
exclude1.s
exclude2.s
exclude3.s
exclude3a.d
exclude3b.d
exclude3c.d
exclude.exp
export-class-def.s
export-class-dep.s
export-class-lib.s
export-class-lib.ver
export-class-ref.s
export-class.exp
export-class.sd
export-class.vd
expr1.d
expr1.s
expr1.t
fini0.s
fini1.s
fini2.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
fini3.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
fini.c
fini.out
finin.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
flags1.d
flags1.ld
flags1.s
foo0.s
foo1.s
foo2.s
foo3.s
foo.c
foo.map
foon.s
frame.exp
frame.s
func1.c
gabiend.rt
gabinormal.rt
gap.s
global1.d
globalaudit.rd
gnubegin.rS
gnunormal.rS
group1.d
group1a.s
group1b.s
group2.d
group3a.d
group3a.s
group3b.d
group3b.s
group4.d
group5.d
group6.d
group7.d
group8.s
group8a.d
group8b.d
group9.s
group9a.d
group9b.d
group10.d
group10.s
group11.d
group12.d
group12.ld
group.ld
hash.d
header.d
header.s
header.t
hidden.out
implib.rd
implib.s
indirect1a.c
indirect1b.c
indirect1c.c
indirect2.c
indirect3.out
indirect3a.c
indirect3b.c
indirect3c.c
indirect4.out
indirect4a.c
indirect4b.c
indirect4c.c
indirect5.map
indirect5.out
indirect5a.c
indirect5b.c
indirect6a.c
indirect.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
init0.s
init1.s
init2.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
init3.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
init-fini-arrays.d
init-fini-arrays.s PR24511, nm should not mark symbols in .init_array as "t" 2019-05-04 16:57:33 +09:30
init-mixed.c
init-mixed.out
init.c
init.out
initn.s Adjust pr14156 test for m68hc1* 2019-03-21 22:19:51 +10:30
interleave-0.d
interleave-4.d
interleave.ld
interleave.s
libbarw.rd
linkinfo1.s
linkinfo1a.d
linkinfo1b.d
linkonce1.d
linkonce1a.s
linkonce1b.s
linkonce2.d
linkoncerdiff1.s
linkoncerdiff2.s
linkoncerdiff.d
linux-x86.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
linux-x86.S
lma.lnk
lma.s
loadaddr1.d
loadaddr1.t
loadaddr2.d
loadaddr2.t
loadaddr3.t
loadaddr3a.d
loadaddr3b.d
loadaddr.s
loadaddr.t
local1.d
local1.map
local1.s
main.c
maxpage1.d
maxpage1.s
maxpage2.d
maxpage3.t
maxpage3a.d
maxpage3b.d
maxpage3c.d
maxpage4.d
maxpage4.t
maxpage5.d
maxpage5.s
maxpage5.t
mbind1.s
mbind1a.d
mbind1b.d
mbind1c.d
mbind2a.s
mbind2b.c
merge2.d
merge2.s
merge3.d
merge3.s
merge.d csky ld testsuite fixes 2019-03-18 22:37:26 +10:30
merge.ld
merge.s
multibss1.d
multibss1.s
needed1.out
needed1a.c
needed1b.c
needed1c.c
needed2.ver
needed2a.c
needed2b.c
needed2c.c
needed3.c
new.cc
nobits-1.d
nobits-1.s
nobits-1.t
noload-1.d
noload-1.s
noload-1.t
noload-2.d
noload-3.d
noload-3.s
noload-3.t
normal.out
note1_1.s
note1_2.s
note1.r
note-1.d
note-1.s
note-1.t
note-2.d
note-2.s
note-2.t
note-3.l
note-3.s
note-3.t
notes.exp
now-1.d
now-2.d
now-3.d
now-4.d
orphan2.d
orphan2.s
orphan3.d
orphan3a.s
orphan3b.s
orphan3c.s
orphan3d.s
orphan3e.s
orphan3f.s
orphan4.d
orphan4.ld
orphan4.s
orphan-5.d
orphan-5.l
orphan-6.d
orphan-6.l
orphan-7.d
orphan-7.map
orphan-8.d
orphan-8.map
orphan-9.d
orphan-9.ld
orphan-9.s
orphan-10.d
orphan-10.s
orphan-11.d
orphan-11.ld
orphan-11.s
orphan-12.d
orphan-12.s
orphan-region.d
orphan-region.ld
orphan-region.s
orphan.d
orphan.ld
orphan.s
overlay.d
overlay.s
overlay.t
pass.out
pie.d
pr349-1.s
pr349-2.s
pr349.d
pr2404.out
pr2404a.c
pr2404b.c
pr9676-1.c
pr9676-2.c
pr9676-3.c
pr9676-4.c
pr9676.rd
pr9679-1.c
pr9679-2.c
pr9679.rd
pr11138-1.c
pr11138-1.map
pr11138-2.c
pr11138-2.map
pr11138.out
pr11304.d
pr11304a.s
pr11304b.s
pr12851.d
pr12851.s
pr12975.d
pr12975.s
pr12975.t
pr13177.d
pr13177.s
pr13195.c
pr13195.d
pr13195.s
pr13195.t
pr13250-1.c
pr13250-2.c
pr13250-3.c
pr13839.d
pr13839.s
pr13839.t
pr14052.d
pr14052.t
pr14156a.d PR24511, nm should not mark symbols in .init_array as "t" 2019-05-04 16:57:33 +09:30
pr14156b.d PR24511, nm should not mark symbols in .init_array as "t" 2019-05-04 16:57:33 +09:30
pr14156c.d
pr14156c.t
pr14170a.s
pr14170b.s
pr14170c.s
pr14323-1.c
pr14323-2.c
pr14525.c
pr14525.out
pr14862-1.c
pr14862-2.c
pr14862.map
pr14862.out
pr14926.d
pr14926.s
pr16322.d
pr16322.s
pr16452.map
pr16452.od
pr16452a.c
pr16452b.c
pr16457.od
pr16496a.c
pr16496a.map
pr16496b.c
pr16496b.od
pr16498a.d
pr16498a.s
pr16498a.t
pr16498b.d
pr16498b.t
pr17068.s
pr17068a.s
pr17068b.s
pr17068c.s
pr17068d.s
pr17068e.s
pr17068ez.s
pr17550-1.s
pr17550-2.s
pr17550-3.s
pr17550-4.s
pr17550a.d
pr17550b.d
pr17550c.d
pr17550d.d
pr17615.d
pr17615.s
pr18458a.c
pr18458b.c
pr18458c.c
pr18718.c
pr18720.out
pr18720.rd
pr18720a.c
pr18720b.c
pr18720c.c
pr18735.d
pr18735.s
pr19005.d
pr19005.s
pr19005.t
pr19073.map
pr19073.rd
pr19073.s
pr19162.d
pr19162a.s
pr19162b.s
pr19539.d
pr19539.s
pr19539.t
pr19553.map
pr19553a.c
pr19553b.c
pr19553b.out
pr19553c.c
pr19553c.out
pr19553d.c
pr19553d.out
pr19579a.c
pr19579b.c
pr19617.s
pr19617a.d
pr19617b.d
pr19617c.d
pr19698.d
pr19698.s
pr19698.t
pr19719a.c
pr19719b.c
pr19719c.c
pr19719d.c
pr19789.d
pr19789.s
pr20513a.d
pr20513a.s
pr20513b.d
pr20513b.s
pr20513c.d
pr20513d.d
pr20513e.d
pr20513f.d
pr20528a.d
pr20528a.s
pr20528b.d
pr20528b.s
pr20828-a.sd
pr20828-b.sd
pr20828-c.sd
pr20828-d.sd
pr20828-e.sd
pr20828-v.ld
pr20828-v.od
pr20828-v.s
pr20828-v.ver
pr20828.ld
pr20828.s
pr20828.ver
pr20995-2so.r
pr20995.r
pr20995a.s
pr20995b.s
pr20995c.s
pr21086.c
pr21086.list
pr21233-e.ld
pr21233-l.s
pr21233-l.sd
pr21233.ld
pr21233.s
pr21233.sd
pr21384.d
pr21384.dl
pr21384.ld
pr21384.s
pr21389.map
pr21389.s
pr21389a.d
pr21389b.d
pr21389c.d
pr21562a.d
pr21562a.s
pr21562a.t
pr21562b.d
pr21562b.s
pr21562b.t
pr21562c.d
pr21562c.t
pr21562d.d
pr21562d.t
pr21562e.d
pr21562f.d
pr21562g.d
pr21562h.d
pr21562i.d
pr21562j.d
pr21562k.d
pr21562l.d
pr21562m.d
pr21562n.d
pr21703-1.s
pr21703-2.s
pr21703-3.s
pr21703-4.s
pr21703-r.sd
pr21703-shared.sd
pr21703.sd
pr21703.ver
pr21884.d csky ld testsuite fixes 2019-03-18 22:37:26 +10:30
pr21884.t
pr21884a.s
pr21884b.s
pr21903.s
pr21903a.d
pr21903b.d
pr21903c.d
pr21903d.d
pr21903e.d
pr21904.d
pr21904.s
pr21964-1a.c
pr21964-1b.c
pr21964-1c.c
pr21964-2a.c
pr21964-2b.c
pr21964-2c.c
pr21964-3a.c
pr21964-3c.c
pr21964-4.c
pr21964-5.c
pr21978.od
pr21978a.c
pr21978b.c
pr22150.vd
pr22150.ver
pr22150a.s
pr22150b.s
pr22263-1.rd
pr22263-1a.c
pr22263-1b.c
pr22269-1.c
pr22269-1.rd
pr22269.s
pr22269a.d
pr22269b.d
pr22319.d Fix some dlx fails 2019-03-21 08:45:28 +10:30
pr22319.s
pr22374-1.r
pr22374-2.r
pr22374a.s
pr22374b.s
pr22393-1.s
pr22393-1a.d
pr22393-1b.d
pr22393-1c.d
pr22393-1d.d
pr22393-1e.d
pr22393-1f.d
pr22393-2a.c
pr22393-2a.rd
pr22393-2b.c
pr22393-2b.rd
pr22423.d
pr22450.d
pr22450.s
pr22471.t
pr22471a.s
pr22471b.s
pr22649-1.s
pr22649-2a.s
pr22649-2ab-mips.msg
pr22649-2b.s
pr22649-2cd-mips.msg
pr22649.msg
pr22677.d
pr22677.s
pr22836-1.s
pr22836-1a.d
pr22836-1b.d
pr22836-2.d
pr22836-2.s
pr23161.map
pr23161a.c
pr23161a.rd
pr23161b.c
pr23161b.rd
pr23161c.c
pr23161c.rd
pr23161d.rd
pr23162.map
pr23162.rd
pr23162a.c
pr23162b.c
pr23428.c
pr23591.d
pr23591a.s
pr23591b.s
pr23591c.s
pr23648.d
pr23648.s
pr23648.t
pr23658-1a.d
pr23658-1a.s
pr23658-1b.d
pr23658-1b.s
pr23658-1c.d
pr23658-1c.s
pr23658-1d.s
pr23658-2.rd
pr23658-3.d
pr23658-3.s
pr23658-3.t
pr23900-1-32.rd
pr23900-1-64.rd
pr23900-1.d
pr23900-1.s
pr23900-2.s
pr23900-2a.d
pr23900-2b.d
pr24511.d PR24511, nm should not mark symbols in .init_array as "t" 2019-05-04 16:57:33 +09:30
preinit.c
preinit.out
provide-hidden-1.ld
provide-hidden-1.s
provide-hidden-2.ld
provide-hidden-2.s
provide-hidden-3.s
provide-hidden-4.s
provide-hidden-abs.nd
provide-hidden-def.nd
provide-hidden-dyn.nd
provide-hidden-s.ld
provide-hidden-s.nd
provide-hidden-sec.nd
provide-hidden.exp
rdynamic-1.c
rdynamic-1.rd
readelf.exp
rel.c
relmain.c
relmain.out
reloc-discard-warn.d
reloc-discard.d
reloc-discard.ld
reloc-discard.s
relocatable.d
relocatable.t
relro1.s
relro2.s
rpath-1.d
rpath-2.d
runpath-1.d
runpath-2.d
sec64k.exp
sec-to-seg1.s
sec-to-seg2.s
sec-to-seg-script-adjoining-pages.t
sec-to-seg-script-disjoint-pages.t
sec-to-seg-script-same-page.t
sec-to-seg.exp
seg.d
seg.s
seg.t
shared.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
simple.s
sizeof.s
sizeofa.d
sizeofb.d
sizeofc.d
stab.d
stack-exec.rd
stack-noexec.rd
stack-size.rd
stack.s
start.s
startof.s
startofa.d
startofb.d
startofc.d
strtab.d
strtab.s
symbol1ref.s
symbol1w.s
symbol2ref.s
symbol2w.s
symbol3.s
symbol3w.s
symbolic-func.r
symbolic-func.s
table.s
tbss1.s
tbss2.s
tbss3.s
tbss.s
tdata1.s
tdata2.s
tdata3.s
textaddr1.d
textaddr2.d
textaddr3.d
textaddr4.d
textaddr5.d
textaddr6.d
textaddr7.d
textrel.map
textrel.rd
textrel.s
textrel.warn
tls_common.exp
tls_common.s
tls_gc.s
tls.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
unknown2.d
unknown2.s
unknown.d
var1.d
var1.s
var1.t
ver_def.ld
ver_def.s
ver_def.vd
ver_def.ver
warn1.d
warn2.d
warn3.d
warn.out
weak-dyn-1.ld
weak-dyn-1.rd
weak-dyn-1a.s
weak-dyn-1b.s
weakdef1.c
wrap1.c
wrap1.out
wrap1a.c
wrap1b.c
wrap.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
x86-feature-1a.rd
x86-feature-1b.rd
x86-feature-1c.rd
x86-feature-1d.rd
x86-feature-1e.rd
zlibbegin.rS
zlibnormal.rS