bfd/mach-o: avoid a crash when num == 0 in reloc.
bfd/ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash when num == 0.
This commit is contained in:
parent
c275b681a5
commit
23d7293976
@ -1,3 +1,8 @@
|
|||||||
|
2014-04-01 Tristan Gingold <gingold@adacore.com>
|
||||||
|
|
||||||
|
* mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash
|
||||||
|
when num == 0.
|
||||||
|
|
||||||
2014-03-27 Yury Gribov <y.gribov@samsung.com>
|
2014-03-27 Yury Gribov <y.gribov@samsung.com>
|
||||||
Pavel Fedin <p.fedin@samsung.com>
|
Pavel Fedin <p.fedin@samsung.com>
|
||||||
|
|
||||||
|
@ -1075,7 +1075,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
|
|||||||
/* An external symbol number. */
|
/* An external symbol number. */
|
||||||
sym = syms + num;
|
sym = syms + num;
|
||||||
}
|
}
|
||||||
else if (num == 0x00ffffff)
|
else if (num == 0x00ffffff || num == 0)
|
||||||
{
|
{
|
||||||
/* The 'symnum' in a non-scattered PAIR is 0x00ffffff. But as this
|
/* The 'symnum' in a non-scattered PAIR is 0x00ffffff. But as this
|
||||||
is generic code, we don't know wether this is really a PAIR.
|
is generic code, we don't know wether this is really a PAIR.
|
||||||
@ -1087,7 +1087,6 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* A section number. */
|
/* A section number. */
|
||||||
BFD_ASSERT (num != 0);
|
|
||||||
BFD_ASSERT (num <= mdata->nsects);
|
BFD_ASSERT (num <= mdata->nsects);
|
||||||
|
|
||||||
sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr;
|
sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user