This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: one more h8300 ld -r problem left


Hi Joel,

: It appears the ld -r adds ctor/dtor symbols to files.
: 
: Any ideas?

This is the fault of the linker script(s).  They unconditionally
create symbols in the .tors section whenever a link happens, so the
linker is forced to create .tors section each time.  The following
patch should fix this.

Cheers
	Nick


2000-11-02  Nick Clifton  <nickc@redhat.com>

	* scripttempl/h8300.sc (.tors): Only create symbols during a
	final link.  This prevents the section from being created
	during a partial link.
	* scripttempl/h8300h.sc (.tors): As above.
	* scripttempl/h8300s.sc (.tors): As above.

Index: ld/scripttempl/h8300h.sc
===================================================================
RCS file: /cvs/src//src/ld/scripttempl/h8300h.sc,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 h8300h.sc
*** h8300h.sc	1999/05/03 07:29:08	1.1.1.1
--- h8300h.sc	2000/11/02 19:46:05
*************** SECTIONS 				
*** 39,50 ****
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
! 	___ctors = . ;
  	*(.ctors)
! 	___ctors_end = . ;
! 	___dtors = . ;
  	*(.dtors)
! 	___dtors_end = . ;
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)
--- 39,50 ----
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
!    	${RELOCATING+ __ctors = . ; }
  	*(.ctors)
!    	${RELOCATING+ __ctors_end = . ; }
!    	${RELOCATING+ __dtors = . ; }
  	*(.dtors)
!    	${RELOCATING+ __dtors_end = . ; }
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)

Index: ld/scripttempl/h8300.sc
===================================================================
RCS file: /cvs/src//src/ld/scripttempl/h8300.sc,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 h8300.sc
*** h8300.sc	1999/05/03 07:29:08	1.1.1.1
--- h8300.sc	2000/11/02 19:46:05
*************** SECTIONS 				
*** 34,45 ****
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
! 	___ctors = . ;
  	*(.ctors)
! 	___ctors_end = . ;
! 	___dtors = . ;
  	*(.dtors)
! 	___dtors_end = . ;
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)
--- 34,45 ----
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
!    	${RELOCATING+ __ctors = . ; }
  	*(.ctors)
!    	${RELOCATING+ __ctors_end = . ; }
!    	${RELOCATING+ __dtors = . ; }
  	*(.dtors)
!    	${RELOCATING+ __dtors_end = . ; }
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)

Index: ld/scripttempl/h8300s.sc
===================================================================
RCS file: /cvs/src//src/ld/scripttempl/h8300s.sc,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 h8300s.sc
*** h8300s.sc	1999/05/03 07:29:08	1.1.1.1
--- h8300s.sc	2000/11/02 19:46:05
*************** SECTIONS 				
*** 39,50 ****
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
! 	___ctors = . ;
  	*(.ctors)
! 	___ctors_end = . ;
! 	___dtors = . ;
  	*(.dtors)
! 	___dtors_end = . ;
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)
--- 39,50 ----
     	${RELOCATING+ _etext = . ; }
  	} ${RELOCATING+ > ram}
  .tors : {
!    	${RELOCATING+ __ctors = . ; }
  	*(.ctors)
!    	${RELOCATING+ __ctors_end = . ; }
!    	${RELOCATING+ __dtors = . ; }
  	*(.dtors)
!    	${RELOCATING+ __dtors_end = . ; }
  	} ${RELOCATING+ > ram}
  .data : {
  	*(.data)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]