[gold][patch] Add a plugin callback for setting the extra search path

Rafael Espindola espindola@google.com
Fri Jun 18 19:40:00 GMT 2010

This patch complements the add_input_library callback by adding the
ability to set the extra search path used by it.

The use case for it is when we have two copies of libc. One being
bitcode and the other ELF. We want to use the bitcode one with the
plugin so that LTO can do as much simplification as possible. The
issues is that when looking for libc again because of a call to the
add_input_library callback, gold will find an archive with bitcode
files and not know what to do with it.

With this patch the users can hide the ELF libc from the -L options
and just have the plugin pass the correct directory in the extra
search path.

2010-06-18  Rafael Espindola  <espindola@google.com>

	* plugin-api.h (ld_plugin_set_extra_library_path): New.
	(ld_plugin_tag): Add LDPT_SET_EXTRA_LIBRARY_PATH.
	(ld_plugin_tv): Add tv_set_extra_library_path.

2010-06-18  Rafael Espindola  <espindola@google.com>

	* fileread.cc (Input_file::find_fie): New
	(Input_file::open): Use Input_file::find_fie.
	* fileread.h (Input_file::find_fie): New
	* plugin.cc (set_extra_library_path): New.
	(Plugin::load): Add set_extra_library_path to the transfer vector.
	(Plugin_manager::set_extra_library_path): New.
	(Plugin_manager::add_input_file): Use the extra search path if set.
	(set_extra_library_path(): New.
	* plugin.h (Plugin_manager): Adde set_extra_library_path and

Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib.patch
Type: text/x-patch
Size: 8542 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100618/e27ce585/attachment.bin>

More information about the Binutils mailing list