ld manual and 3.4.2 Commands Dealing with Files

Ian Lance Taylor iant@google.com
Wed Dec 29 18:40:00 GMT 2010


ali hagigat <hagigatali@gmail.com> writes:

> 3.4.2 Commands Dealing with Files
> AS_NEEDED(file , file , ...)
> AS_NEEDED(file file ...)
> This construct essentially enables ‘--as-needed’ option for all the
> files listed inside of it and restores
> previous ‘--as-needed’ resp. ‘--no-as-needed’ setting afterwards.
> ------------------------------------------------------------------------------------------
> I have copied part of ld manual. I think the above sentence does not
> make sense and needs correction!
> "previous ‘--as-needed’ resp.", what is it saying?

That sentence is written terribly but it does make sense.  What it says
is that AS_NEEDED enables the --as-needed option for the files in the
list.  For files not in the list the previous setting of --as-needed is
used.  That previous setting may be either --as-needed or
--no-as-needed, depending on what was used on the command line.

Ian



More information about the Binutils mailing list