]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Fix linker crash in section symbol check.
authorJim Wilson <jimw@sifive.com>
Thu, 21 Mar 2019 22:08:48 +0000 (15:08 -0700)
committerJim Wilson <jimw@sifive.com>
Thu, 21 Mar 2019 22:16:19 +0000 (15:16 -0700)
commita9f5a5517fb7df640f0fcd4cb0f9961818b6505b
treea72de21479b1e52dcf700b652378fd5d04430509
parent4e5391148d51c58785aad637f1a92d47b91b3ae6
RISC-V: Fix linker crash in section symbol check.

sym is only set for local symbols.  h is only set for global symbols.  Gas
won't let me create a global section symbol, but bfd appears to have some
support for that, and I can't rule out that other assemblers might do this.
So we need to support both, and verify sym and h are non-NULL before using.

bfd/
PR 24365
* elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check,
verify sym non-NULL before using.  Add identical check using h.
bfd/ChangeLog
bfd/elfnn-riscv.c