RFA: GOLD: Allow INPUT linker script commands to input libraries

Nick Clifton nickc@redhat.com
Tue Jun 8 11:57:00 GMT 2010


Hi Ian,

  Currently GOLD's implementation of the INPUT linker script command
  does not support inputting libraries via the "-l<name>" syntax.  This
  is a problem as some current Linux libraries make use of this
  feature.  Eg the 64-bit version of the wide-character ncurses library
  looks like this:

    % cat /usr/lib64/libncursesw.so
    INPUT(libncursesw.so.5 -ltinfo)

  The attached patch is my poor attempt at adding support for this
  feature.  It works for the small test case I have been using locally,
  but I would certainly some guidance as to whether it is acceptable for
  inclusion into the gold sources.

  (Incidentally I wanted to put the check for the 'l' character in the
  "-l<name>" sequence into the yyscript.y file, but I could not get this
  to work.  I think that my bison-fu must be weak).

Cheers
  Nick

gold/ChangeLog
2010-06-08  Nick Clifton  <nickc@redhat.com>

	* yyscript.y (input_list_element): Allow strings prefixed with
	the '-' character.  Treat these as libraries.
	* script.cc (script_add_library): New function.  Adds a library
	specified by "-l<name>" found in an input script.
	* script-c.h: Add prototype for script_add_library.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gold.INPUT.patch
Type: text/x-patch
Size: 2495 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100608/e16c31c6/attachment.bin>


More information about the Binutils mailing list