]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
CRIS: fix PR ld/26589, a missing NULL check in fix for PR ld/22269
authorHans-Peter Nilsson <hp@axis.com>
Tue, 15 Sep 2020 01:59:06 +0000 (03:59 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Tue, 15 Sep 2020 01:59:06 +0000 (03:59 +0200)
commitef6b667ead5c32c7d26faffff58f1f86f70a662b
tree41c6cdfa5f75cf0a0fae3f2a2d189ae5589da1c6
parent702759286fde3840d8df5debe10fd752b3bd0126
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.

(cherry picked from commit 4a8f181d196f85ca153fe51ca6bb40942e0e1ed7)
bfd/ChangeLog
bfd/elf32-cris.c
ld/ChangeLog
ld/testsuite/ld-cris/locref3.s [new file with mode: 0644]
ld/testsuite/ld-cris/pr26589.d [new file with mode: 0644]