[RFC PATCH]: Sparc gold support

David Miller davem@davemloft.net
Tue Apr 15 03:49:00 GMT 2008


From: Ian Lance Taylor <iant@google.com>
Date: Mon, 14 Apr 2008 17:16:24 -0700

> Doing it the right way, such that a single linker binary could
> generate either Linux or Solaris executables, selectable by -m or -b,
> would be harder.  But probably not that much harder.  To select by the
> -b option, we would introduce a new Target_selector with a different
> name.  Then the configure script would just have to specify which one
> should be the default.
> 
> gold currently ignores the -m option.  As far as I know, the main
> reason to recognize -m would be to support FreeBSD, which uses special
> -m options to change the default interpreter name.  gold has nothing
> like the full power of GNU ld emulations, but that's OK because nobody
> uses them for ELF.  For gold -m would select a different Target.  We
> would either conflate the -m and -b namespace, or we could introduce a
> new function parallel to select_target_by_name.

I think this is the way to go, or at least something like it.

> Right, but the value() method is templated.  It's not a virtual
> function, and it shouldn't be because that will increase the size of
> the Symbol structure for no benefit.  So if you want to call value()
> from a non-template function, then you need a test on size.  Which is
> not particularly expensive--it will be a very predictable branch in a
> given execution--but it's not entirely free either.
> 
> Actually you could also do it by setting up Target_sparc::Scan and
> Target_sparc::Relocate to have virtual functions for the size.  Then
> the subsidiary functions would not be template functions.

I'll explore these ideas when I get a chance, thanks Ian.



More information about the Binutils mailing list