binutils-gdb/ld/testsuite/ld-cris/pr26589.d
Hans-Peter Nilsson 4a8f181d19 CRIS: fix PR ld/26589, a missing NULL check in fix for PR ld/22269
Not sure why there wasn't a NULL check in the ld/22269 patch
(e01c16a8) at the time, as there was one for the corresponding patch
to elf32-m68k.c (5056ba1d).

Incidentally, I had missed that in 2017, as a prerequisite for the
ld/22269 series, the check_relocs function finally were made "safe"!
(I.e. the number of references and symbol types are final, garbage
collection done, so port-specific accounting can be made sanely.)

Committed.

bfd:
	PR ld/26589
	* elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
	on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.

ld:
	PR ld/26589
	* testsuite/ld-elf/pr26589.d, testsuite/ld-elf/locref3.s: New test.
2020-09-15 02:57:39 +02:00

17 lines
549 B
Makefile

#source: dso-1.s
#source: locref3.s
#as: --pic --no-underscore --em=criself
#ld: --shared -m crislinux
#readelf: --dyn-syms -r
# Besides typical DSO stuff (libdso-1.d), we here have a data section
# with an absolute reloc to a local symbol. For the original
# test-case, this happened for a destructor (.dtors).
Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entry:
Offset[ ]+Info[ ]+Type[ ]+Sym\.Value Sym\. Name \+ Addend
[a-f0-9]+[ ]+0+c R_CRIS_RELATIVE[ ]+ [a-f0-9]+
Symbol table '\.dynsym' contains 3 entries:
#pass