diff options
author | Alan Modra <amodra@gmail.com> | 2014-03-14 11:25:59 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-03-14 12:54:24 +1030 |
commit | d4ae5fb0b5d1ae4270b3343509e8bd2d529aa291 (patch) | |
tree | c9c91d0fd583689b7f204415b871632089d7ba1a /ld/ldlang.c | |
parent | d6b6434614d9752d705d4f3199c3d59330938c66 (diff) | |
download | gdb-d4ae5fb0b5d1ae4270b3343509e8bd2d529aa291.zip gdb-d4ae5fb0b5d1ae4270b3343509e8bd2d529aa291.tar.gz gdb-d4ae5fb0b5d1ae4270b3343509e8bd2d529aa291.tar.bz2 |
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 57e2ee8..37ef265 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -1063,13 +1063,6 @@ new_afile (const char *name, p->flags.whole_archive = input_flags.whole_archive; p->flags.sysrooted = input_flags.sysrooted; - if (file_type == lang_input_file_is_l_enum - && name[0] == ':' && name[1] != '\0') - { - file_type = lang_input_file_is_search_file_enum; - name = name + 1; - } - switch (file_type) { case lang_input_file_is_symbols_only_enum: @@ -1083,7 +1076,13 @@ new_afile (const char *name, p->local_sym_name = name; break; case lang_input_file_is_l_enum: - p->filename = name; + if (name[0] == ':' && name[1] != '\0') + { + p->filename = name + 1; + p->flags.full_name_provided = TRUE; + } + else + p->filename = name; p->local_sym_name = concat ("-l", name, (const char *) NULL); p->flags.maybe_archive = TRUE; p->flags.real = TRUE; |