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


   Date: Thu, 2 Nov 2000 11:49:00 -0800
   From: Nick Clifton <nickc@redhat.com>

   : 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.

   !    	${RELOCATING+ __ctors = . ; }

You should build constructors based on CONSTRUCTING, not on
RELOCATING.  That is what permits the -Ur option to work.

	   *(.ctors)

You should only put the .ctors section into the .text section when
CONSTRUCTING.  Otherwise, -r will break because the .ctors will be
lost in the .text section after the relocateable link, so they will
not be used in the final link.  I think m68kcoff.sc gets it right.

Ian

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