-Wl,<options> mechanism

Jim Wilson wilson@specifixinc.com
Thu Nov 6 02:10:00 GMT 2003


Tal Agmon wrote:
> I'm using GCC version 3.3.2, the target is i686-pc-linux-gnu.
> It seems that the -Wl,<options> command option is not working correctly :

It is hard to understand what you are complaining about.  Your message 
is not very clear.  Please give an example.

Gcc does attempt to preserve the order of options as much as possible, 
but since there are multiple ways of specifying options on command lines 
and via specs, we can't always ensure this.

Note that some linker options are library specific and may come in 
pairs.  So if someone specifies
	-Wl,-Bsymbolic foo.so -Wl,-Bdynamic bar.so
then we must preserve the order of these four options to get the right 
affect.  There is a complication here though because foo.so is not an 
option, it is a file name.  So in order to get this right, we treat 
linker options similarly to how we treat filenames, to ensure that their 
relative order does not change.

This is an issue that does not apply to preprocessor or assembler 
options, because we do not support the ability to turn on different 
options for different preprocessor/assembler input files.  Because of 
this, we can not necessarily make linker options work the same way as 
preprocessor/assembler options.

Perhaps this could be improved by treating linker input files as if they 
were options instead of the other way around, but it isn't clear if this 
helps you.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list