gold patch committed: Simplify system directory handling

Ian Lance Taylor iant@google.com
Sat Feb 28 04:42:00 GMT 2009


When gold warns about undefined symbols in shared libraries, it avoids
issuing a warning if the shared library is in a system directory.  This
is to avoid warning about symbols which are defined in the dynamic
linker and referenced by -ldl.  Currently gold decides whether a library
is in a system directory based on whether it is in the directory in
which gold finds libc.so.  This is a somewhat shaky heuristic.

gold already has a different heuristic for a system directory, which it
uses to decide whether to put a directory into the sysroot if there is
one.  I committed this patch to make gold use the latter heuristic to
pick a system directory.  This permitted some minor code
simplifications.  I think this heuristic is slightly better.

Ian


2009-02-27  Ian Lance Taylor  <iant@google.com>

	PR 6811
	* options.h (class Search_directory): Add is_system_directory.
	(class General_options): Declare is_in_system_directory.
	* options.cc (get_relative_sysroot): Make static.
	(get_default_sysroot): Make static.
	(General_optoins::is_in_system_directory): New function.
	* fileread.cc (Input_file::is_in_system_directory): New function.
	* fileread.h (class Input_file): Declare is_in_system_directory.
	* object.h (class Object): Add is_in_system_directory.
	(class Input_objects): Remove system_library_directory_ field.
	* object.cc (Input_objects::add_object): Don't set
	system_library_directory_.
	(input_objects::found_in_system_library_directory): Remove.
	* symtab.cc (Symbol_table::write_globals): Remove input_objects
	parameter.  Change all callers.
	(Symbol_table::sized_write_globals): Likewise.
	(Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
	Call Object::is_in_system_directory.
	* symtab.h (class Symbol_table): Update declarations.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 13809 bytes
Desc: Simplify system directory handling
URL: <https://sourceware.org/pipermail/binutils/attachments/20090228/bd8da03b/attachment.bin>


More information about the Binutils mailing list