This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: one more h8300 ld -r problem left
- To: nickc at redhat dot com
- Subject: Re: one more h8300 ld -r problem left
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 2 Nov 2000 16:45:06 -0800
- CC: joel dot sherrill at OARcorp dot com, BINUTILS at sources dot redhat dot com
- References: <200011021949.LAA29493@elmo.cygnus.com>
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