Remove search path from -l:namespec DT_NEEDED

For libraries without a soname, -l:libfoo.so set DT_NEEDED to the search
dir plus filename, while gold and -lfoo just use the filename.  This
patch fixes the inconsistency.

	* ldlang.h (full_name_provided): New input flag.
	* ldlang.c (new_afile): Don't use lang_input_file_is_search_file_enum
	for -l:namespec.  Instead use lang_input_file_is_l_enum with
	full_name_provided flag.
	* ldlfile.c (ldfile_open_file_search): Don't complete lib name if
	full_name_provided flag is set.
	* emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive):
	Handle full_name_provided libraries.  Tidy EXTRA_SHLIB_EXTENSION
	support.  Set DT_NEEDED for -l:namespec as namespec.
	* emultempl/aix.em (ppc_after_open_output): Handle full_name_provided.
	* emultempl/linux.em (gld${EMULATION_NAME}_open_dynamic_archive):
	Don't handle full_name_provided libraries.
	* emultempl/pe.em (gld${EMULATION_NAME}_open_dynamic_archive): Ditto.
	* emultempl/pep.em (gld${EMULATION_NAME}_open_dynamic_archive): Ditto.
	* emultempl/vms.em (gld${EMULATION_NAME}_open_dynamic_archive): Ditto.
This commit is contained in:
Alan Modra
2014-03-14 11:25:59 +10:30
parent d6b6434614
commit d4ae5fb0b5
10 changed files with 72 additions and 40 deletions

View File

@@ -235,6 +235,9 @@ struct lang_input_statement_flags
/* 1 means this file was specified in a -l option. */
unsigned int maybe_archive : 1;
/* 1 means this file was specified in a -l:namespec option. */
unsigned int full_name_provided : 1;
/* 1 means search a set of directories for this file. */
unsigned int search_dirs : 1;