aboutsummaryrefslogtreecommitdiff
path: root/bfd/mach-o.c
diff options
context:
space:
mode:
authorTristan Gingold <tristan.gingold@adacore.com>2014-04-01 14:34:04 +0200
committerTristan Gingold <tristan.gingold@adacore.com>2014-04-01 14:34:04 +0200
commit23d72939765598839d20dfb70c986206bf7751ca (patch)
tree34b72817a920e5a0c2c11e58d411915b8d9277ac /bfd/mach-o.c
parentc275b681a57c50a6ed5d7cb5192be588fd451427 (diff)
downloadgdb-23d72939765598839d20dfb70c986206bf7751ca.zip
gdb-23d72939765598839d20dfb70c986206bf7751ca.tar.gz
gdb-23d72939765598839d20dfb70c986206bf7751ca.tar.bz2
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.
Diffstat (limited to 'bfd/mach-o.c')
-rw-r--r--bfd/mach-o.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index ebaa6c7..e33c01f 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -1075,7 +1075,7 @@ bfd_mach_o_canonicalize_one_reloc (bfd *abfd,
/* An external symbol number. */
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
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
{
/* A section number. */
- BFD_ASSERT (num != 0);
BFD_ASSERT (num <= mdata->nsects);
sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr;