Don't segfault in mips reloc special_functions
authorAlan Modra <amodra@gmail.com>
Tue, 20 Jun 2023 00:16:03 +0000 (09:46 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 20 Jun 2023 00:31:50 +0000 (10:01 +0930)
commit75e73c6cadcc064c2a0fd03396666574cd5335ca
treef6e218f4775f094f072eb48ded852c0a5b792cb8
parenta89e364b45a93acd20f48abd787ef5cb7c07f683
Don't segfault in mips reloc special_functions

A symbol defined in a section from a shared library will have a NULL
section->output_section during linking.

* elf32-mips.c (gprel32_with_gp): Don't segfault on NULL
symbol->section->output_section.
* elf64-mips.c (mips_elf64_gprel32_reloc): Likewise.
* elfn32-mips.c (mips_elf_gprel16_reloc): Likewise.
(mips_elf_literal_reloc, mips_elf_gprel32_reloc): Likewise.
(gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Likewise.
(_bfd_mips_elf_generic_reloc): Likewise.
bfd/elf32-mips.c
bfd/elf64-mips.c
bfd/elfn32-mips.c
bfd/elfxx-mips.c