Hi Vladimir,
One, may be stupid, question.
Not stupid at - it is perfectly reasonable.
As I understand gcc checks linker properties in configure scripts
to adjust code-generation.
Correct.
You are suggesting to build a toolchain
with 2 linkers(bfd/gold).
Yes.
So question, which linker will be used in gcc configure?
The bfd linker, if configuring gcc in a combined source tree along with
the binutils, otherwise the linker found in the system's search path.
This is actually a bug which I had not considered, albeit a minor one.
Even if the use configures with --enable-gold or --enable-gold=both/gold
then the gold sources will *not* be the ones examined for the capability
tests performed by gcc's configure scripts. This should not matter
though, because of ...
What if another linker has other properties?
That would be bad.
Are gold and bfd linkers similar in above aspects?
... Yes. In fact this is one of the main design goals of gold - to be
able to act as a drop in replacement for ld with all the same features
and capabilities.
One of the reasons that I created this patch in the first place was that
I wanted toolchain builders to be able to experiment with the new linker
(gold) whilst retaining the ability to use the known-good linker (ld.bfd).
Cheers
Nick