mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
PR25900, RISC-V: null pointer dereference
PR 25900 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before accessing root.u.def of symbols. Also check root.u.def.section is non-NULL. Reverse tests so as to make the logic positive.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2020-05-01 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 25900
|
||||||
|
* elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
|
||||||
|
accessing root.u.def of symbols. Also check root.u.def.section
|
||||||
|
is non-NULL. Reverse tests so as to make the logic positive.
|
||||||
|
|
||||||
2020-05-01 Alan Modra <amodra@gmail.com>
|
2020-05-01 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 25882
|
PR 25882
|
||||||
|
@ -4161,15 +4161,16 @@ _bfd_riscv_relax_section (bfd *abfd, asection *sec,
|
|||||||
symval = 0;
|
symval = 0;
|
||||||
sym_sec = bfd_und_section_ptr;
|
sym_sec = bfd_und_section_ptr;
|
||||||
}
|
}
|
||||||
else if (h->root.u.def.section->output_section == NULL
|
else if ((h->root.type == bfd_link_hash_defined
|
||||||
|| (h->root.type != bfd_link_hash_defined
|
|| h->root.type == bfd_link_hash_defweak)
|
||||||
&& h->root.type != bfd_link_hash_defweak))
|
&& h->root.u.def.section != NULL
|
||||||
continue;
|
&& h->root.u.def.section->output_section != NULL)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
symval = h->root.u.def.value;
|
symval = h->root.u.def.value;
|
||||||
sym_sec = h->root.u.def.section;
|
sym_sec = h->root.u.def.section;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
if (h->type != STT_FUNC)
|
if (h->type != STT_FUNC)
|
||||||
reserve_size =
|
reserve_size =
|
||||||
|
Reference in New Issue
Block a user