diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2020-09-15 02:57:39 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2020-09-15 02:57:39 +0200 |
commit | 4a8f181d196f85ca153fe51ca6bb40942e0e1ed7 (patch) | |
tree | 13880086e0071890f366e9c9fd9e4daab008025a /bfd/elf32-cris.c | |
parent | e1044e6adca7d48674d70a860b3a5939fe44323f (diff) | |
download | fsf-binutils-gdb-4a8f181d196f85ca153fe51ca6bb40942e0e1ed7.zip fsf-binutils-gdb-4a8f181d196f85ca153fe51ca6bb40942e0e1ed7.tar.gz fsf-binutils-gdb-4a8f181d196f85ca153fe51ca6bb40942e0e1ed7.tar.bz2 |
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.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r-- | bfd/elf32-cris.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 6e5a2d8..61f4b24 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -3359,7 +3359,7 @@ cris_elf_check_relocs (bfd *abfd, /* No need to do anything if we're not creating a shared object. */ if (! bfd_link_pic (info) - || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) + || (h != NULL && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))) break; /* We may need to create a reloc section in the dynobj and made room |