This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Linker documentation patch


Hi Guys,

  A couple of people have been caught out by gcc silently dropping
  linker command line switches which are not preceeded by -Wl,  One
  day I may actually get around to fixing gcc so that it generates an
  appropriate warning message, but in the meantime I have applied this
  patch to the linker documentation:

Cheers
	Nick

2000-01-07  Nick Clifton  <nickc@cygnus.com>

	* ld.texinfo (Options): Remind users to preceed linker command
	line switches with -Wl, if it is being invoked by a comnpiler
	driver program.

Index: ld.texinfo
===================================================================
RCS file: /cvs/binutils/binutils/ld/ld.texinfo,v
retrieving revision 1.8
diff -p -r1.8 ld.texinfo
*** ld.texinfo	2000/01/05 14:12:23	1.8
--- ld.texinfo	2000/01/07 19:02:13
*************** requires them.  For example, @samp{--ofo
*** 228,233 ****
--- 228,247 ----
  @samp{--oformat=srec} are equivalent.  Unique abbreviations of the names
  of multiple-letter options are accepted.
  
+ Note - if the linker is being invoked indirectly, via a compiler driver
+ (eg @samp{gcc}) then all the linker command line options should be
+ prefixed by @samp{-Wl,}  like this:
+ 
+ @smallexample
+   gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
+ @end smallexample
+ 
+ This is important, because otherwise the compiler driver program may
+ silently drop the linker options, resulting in a bad link.
+ 
+ Here is a table of the generic command line switches accepted by the GNU
+ linker:
+ 
  @table @code
  @kindex -a@var{keyword}
  @item -a@var{keyword}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]