2007-07-27 Michael Snyder * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Move alloc above if block, since both branches rely on it. Index: elf-eh-frame.c =================================================================== RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v retrieving revision 1.62 diff -p -r1.62 elf-eh-frame.c *** elf-eh-frame.c 12 Jul 2007 07:16:41 -0000 1.62 --- elf-eh-frame.c 27 Jul 2007 21:18:16 -0000 *************** _bfd_elf_discard_section_eh_frame *** 586,591 **** --- 586,600 ---- REQUIRE (skip_bytes (&buf, end, 4)); hdr_id = bfd_get_32 (abfd, buf - 4); + if (ecie_count == ecie_alloced) + { + ecies = bfd_realloc (ecies, + (ecie_alloced + 20) * sizeof (*ecies)); + REQUIRE (ecies); + memset (&ecies[ecie_alloced], 0, 20 * sizeof (*ecies)); + ecie_alloced += 20; + } + if (hdr_id == 0) { unsigned int initial_insn_length; *************** _bfd_elf_discard_section_eh_frame *** 593,607 **** /* CIE */ this_inf->cie = 1; - if (ecie_count == ecie_alloced) - { - ecies = bfd_realloc (ecies, - (ecie_alloced + 20) * sizeof (*ecies)); - REQUIRE (ecies); - memset (&ecies[ecie_alloced], 0, 20 * sizeof (*ecies)); - ecie_alloced += 20; - } - cie = &ecies[ecie_count].cie; ecies[ecie_count].offset = this_inf->offset; ecies[ecie_count++].entry = sec_info->count; --- 602,607 ----