2006-05-12 H.J. Lu PR ld/2655 PR ld/2657 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly update CIE/FDE length. --- bfd/elf-eh-frame.c.eh 2006-05-02 06:49:58.000000000 -0700 +++ bfd/elf-eh-frame.c 2006-05-12 17:19:33.000000000 -0700 @@ -1075,12 +1075,12 @@ _bfd_elf_write_section_eh_frame (bfd *ab end = buf + ent->size; new_size = size_of_output_cie_fde (ent, ptr_size); - /* Install the new size, filling the extra bytes with DW_CFA_nops. */ + /* Update the size. It may be shrinked. */ + bfd_put_32 (abfd, new_size - 4, buf); + + /* Filling the extra bytes with DW_CFA_nops. */ if (new_size != ent->size) - { - memset (end, 0, new_size - ent->size); - bfd_put_32 (abfd, new_size - 4, buf); - } + memset (end, 0, new_size - ent->size); if (ent->cie) {