Bug 11083 - Gold does not supports -G option for creating shared libs
Summary: Gold does not supports -G option for creating shared libs
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.20
: P3 enhancement
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-11 16:19 UTC by Takis Psarogiannalopoulos
Modified: 2010-01-08 21:10 UTC (History)
1 user (show)

See Also:
Host:
Target: (Any)
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takis Psarogiannalopoulos 2009-12-11 16:19:49 UTC
Gold linker doesnt handle the typical svr4 option -G vfor creating shared
objects. As this option (-G) is implemented for most systems in GNU libtool it
can be a problem for some systems.
Comment 1 Takis Psarogiannalopoulos 2009-12-11 16:41:03 UTC
simple solution (not implementing the most complicated -G size as gnu ld, jusr
-G as its used on a typical SVR4)

options.h

+  DEFINE_bool(G, options::ONE_DASH, '\0', false,
+              N_("Generate shared library"), NULL);

options.cc  

-  if (this->Bshareable())  
+  if ( (this->Bshareable()) || (this->G()) )
+    this->set_shared(true);

Comment 2 Ian Lance Taylor 2010-01-08 21:10:05 UTC
Thanks for the bug report.  This has been fixed, and gold now supports -G.