patch applied to ld/emultempl/sh64elf.em

Joern Rennecke joern.rennecke@superh.com
Tue Jul 8 18:07:00 GMT 2003


This patch is needed to allow c++ programs with exception handling to link.

2003-07-08  J"orn Rennecke <joern.rennecke@superh.com>

	* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
	Allow second call from ldemul_finish.

Index: emultempl/sh64elf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/sh64elf.em,v
retrieving revision 1.5
diff -p -r1.5 sh64elf.em
*** emultempl/sh64elf.em	27 Jun 2003 00:38:25 -0000	1.5
--- emultempl/sh64elf.em	8 Jul 2003 17:11:32 -0000
*************** sh64_elf_${EMULATION_NAME}_after_allocat
*** 375,381 ****
        }
      }
  
!   BFD_ASSERT (cranges->contents == NULL);
    BFD_ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
  
    /* Make sure we have .cranges in memory even if there were only
--- 375,388 ----
        }
      }
  
!   /* ldemul_after_allocation may be called twice.  First directly from
!      lang_process, and the second time when lang_process calls ldemul_finish,
!      which calls gld${EMULATION_NAME}_finish, e.g. gldshelf32_finish, which
!      is defined in emultempl/elf32.em and calls ldemul_after_allocation,
!      if bfd_elf${ELFSIZE}_discard_info returned true.  */
!   if (cranges->contents != NULL)
!     free (cranges->contents);
! 
    BFD_ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
  
    /* Make sure we have .cranges in memory even if there were only



More information about the Binutils mailing list