From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Clifton To: binutils@sourceware.cygnus.com Subject: Linker documentation patch Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <200001071907.LAA09059@elmo.cygnus.com> X-SW-Source: 2000-q1/msg00045.html Message-ID: <20000401000000.ieSkG58o573-YQjloGxCSmFElaGV1EO4ACKszvEayPQ@z> 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 * 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}