Replace is_archive with maybe_archive.

2010-12-05  H.J. Lu  <hongjiu.lu@intel.com>

	* ldfile.c (ldfile_open_file_search): Check maybe_archive instead
	of is_archive.
	* emultempl/aix.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/pep.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/vms.em: Likewise.

	* ldlang.c (new_afile): Set maybe_archive instead of is_archive..

	* ldlang.h (lang_input_statement_struct): Replace is_archive
	with maybe_archive.
This commit is contained in:
H.J. Lu 2010-12-06 00:07:06 +00:00
parent cfac8028e4
commit b7f95647fd
11 changed files with 36 additions and 19 deletions

View file

@ -1,3 +1,20 @@
2010-12-05 H.J. Lu <hongjiu.lu@intel.com>
* ldfile.c (ldfile_open_file_search): Check maybe_archive instead
of is_archive.
* emultempl/aix.em: Likewise.
* emultempl/elf32.em: Likewise.
* emultempl/linux.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/sunos.em: Likewise.
* emultempl/vms.em: Likewise.
* ldlang.c (new_afile): Set maybe_archive instead of is_archive..
* ldlang.h (lang_input_statement_struct): Replace is_archive
with maybe_archive.
2010-12-05 H.J. Lu <hongjiu.lu@intel.com> 2010-12-05 H.J. Lu <hongjiu.lu@intel.com>
* plugin.c (asymbol_from_plugin_symbol): Properly convert LTO * plugin.c (asymbol_from_plugin_symbol): Properly convert LTO

View file

@ -1426,7 +1426,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch,
{ {
char *path; char *path;
if (!entry->is_archive) if (!entry->maybe_archive)
return FALSE; return FALSE;
path = concat (search->name, "/lib", entry->filename, arch, ".a", NULL); path = concat (search->name, "/lib", entry->filename, arch, ".a", NULL);

View file

@ -1618,7 +1618,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
const char *filename; const char *filename;
char *string; char *string;
if (! entry->is_archive) if (! entry->maybe_archive)
return FALSE; return FALSE;
filename = entry->filename; filename = entry->filename;
@ -1672,7 +1672,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
if (bfd_check_format (entry->the_bfd, bfd_object) if (bfd_check_format (entry->the_bfd, bfd_object)
&& (entry->the_bfd->flags & DYNAMIC) != 0) && (entry->the_bfd->flags & DYNAMIC) != 0)
{ {
ASSERT (entry->is_archive && entry->search_dirs_flag); ASSERT (entry->maybe_archive && entry->search_dirs_flag);
/* Rather than duplicating the logic above. Just use the /* Rather than duplicating the logic above. Just use the
filename we recorded earlier. */ filename we recorded earlier. */

View file

@ -62,7 +62,7 @@ gld${EMULATION_NAME}_open_dynamic_archive
{ {
char *string; char *string;
if (! entry->is_archive) if (! entry->maybe_archive)
return FALSE; return FALSE;
string = (char *) xmalloc (strlen (search->name) string = (char *) xmalloc (strlen (search->name)

View file

@ -2086,7 +2086,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
unsigned int i; unsigned int i;
if (! entry->is_archive) if (! entry->maybe_archive)
return FALSE; return FALSE;
filename = entry->filename; filename = entry->filename;

View file

@ -1824,7 +1824,7 @@ gld_${EMULATION_NAME}_open_dynamic_archive
unsigned int i; unsigned int i;
if (! entry->is_archive) if (! entry->maybe_archive)
return FALSE; return FALSE;
filename = entry->filename; filename = entry->filename;

View file

@ -157,7 +157,7 @@ gld${EMULATION_NAME}_find_so (lang_input_statement_type *inp)
struct stat st; struct stat st;
if (! inp->search_dirs_flag if (! inp->search_dirs_flag
|| ! inp->is_archive || ! inp->maybe_archive
|| ! inp->dynamic) || ! inp->dynamic)
return; return;
@ -889,7 +889,7 @@ gld${EMULATION_NAME}_count_need (lang_input_statement_type *inp)
{ {
++need_entries; ++need_entries;
need_size += NEED_ENTRY_SIZE; need_size += NEED_ENTRY_SIZE;
if (! inp->is_archive) if (! inp->maybe_archive)
need_size += strlen (inp->filename) + 1; need_size += strlen (inp->filename) + 1;
else else
{ {
@ -917,7 +917,7 @@ gld${EMULATION_NAME}_set_need (lang_input_statement_type *inp)
referential locality. */ referential locality. */
bfd_put_32 (link_info.output_bfd, need_pnames - need_contents, bfd_put_32 (link_info.output_bfd, need_pnames - need_contents,
need_pinfo); need_pinfo);
if (! inp->is_archive) if (! inp->maybe_archive)
{ {
bfd_put_32 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 4); bfd_put_32 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 4);
bfd_put_16 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 8); bfd_put_16 (link_info.output_bfd, (bfd_vma) 0, need_pinfo + 8);

View file

@ -52,7 +52,7 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED,
{ {
char *string; char *string;
if (! entry->is_archive) if (! entry->maybe_archive)
return FALSE; return FALSE;
string = (char *) xmalloc (strlen (search->name) string = (char *) xmalloc (strlen (search->name)

View file

@ -370,7 +370,7 @@ ldfile_open_file_search (const char *arch,
/* If this is not an archive, try to open it in the current /* If this is not an archive, try to open it in the current
directory first. */ directory first. */
if (! entry->is_archive) if (! entry->maybe_archive)
{ {
if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename)) if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
{ {
@ -407,7 +407,7 @@ ldfile_open_file_search (const char *arch,
} }
} }
if (entry->is_archive) if (entry->maybe_archive)
string = concat (search->name, slash, lib, entry->filename, string = concat (search->name, slash, lib, entry->filename,
arch, suffix, (const char *) NULL); arch, suffix, (const char *) NULL);
else else

View file

@ -1015,7 +1015,7 @@ new_afile (const char *name,
{ {
case lang_input_file_is_symbols_only_enum: case lang_input_file_is_symbols_only_enum:
p->filename = name; p->filename = name;
p->is_archive = FALSE; p->maybe_archive = FALSE;
p->real = TRUE; p->real = TRUE;
p->local_sym_name = name; p->local_sym_name = name;
p->just_syms_flag = TRUE; p->just_syms_flag = TRUE;
@ -1023,14 +1023,14 @@ new_afile (const char *name,
break; break;
case lang_input_file_is_fake_enum: case lang_input_file_is_fake_enum:
p->filename = name; p->filename = name;
p->is_archive = FALSE; p->maybe_archive = FALSE;
p->real = FALSE; p->real = FALSE;
p->local_sym_name = name; p->local_sym_name = name;
p->just_syms_flag = FALSE; p->just_syms_flag = FALSE;
p->search_dirs_flag = FALSE; p->search_dirs_flag = FALSE;
break; break;
case lang_input_file_is_l_enum: case lang_input_file_is_l_enum:
p->is_archive = TRUE; p->maybe_archive = TRUE;
p->filename = name; p->filename = name;
p->real = TRUE; p->real = TRUE;
p->local_sym_name = concat ("-l", name, (const char *) NULL); p->local_sym_name = concat ("-l", name, (const char *) NULL);
@ -1039,7 +1039,7 @@ new_afile (const char *name,
break; break;
case lang_input_file_is_marker_enum: case lang_input_file_is_marker_enum:
p->filename = name; p->filename = name;
p->is_archive = FALSE; p->maybe_archive = FALSE;
p->real = FALSE; p->real = FALSE;
p->local_sym_name = name; p->local_sym_name = name;
p->just_syms_flag = FALSE; p->just_syms_flag = FALSE;
@ -1048,7 +1048,7 @@ new_afile (const char *name,
case lang_input_file_is_search_file_enum: case lang_input_file_is_search_file_enum:
p->sysrooted = ldlang_sysrooted_script; p->sysrooted = ldlang_sysrooted_script;
p->filename = name; p->filename = name;
p->is_archive = FALSE; p->maybe_archive = FALSE;
p->real = TRUE; p->real = TRUE;
p->local_sym_name = name; p->local_sym_name = name;
p->just_syms_flag = FALSE; p->just_syms_flag = FALSE;
@ -1056,7 +1056,7 @@ new_afile (const char *name,
break; break;
case lang_input_file_is_file_enum: case lang_input_file_is_file_enum:
p->filename = name; p->filename = name;
p->is_archive = FALSE; p->maybe_archive = FALSE;
p->real = TRUE; p->real = TRUE;
p->local_sym_name = name; p->local_sym_name = name;
p->just_syms_flag = FALSE; p->just_syms_flag = FALSE;

View file

@ -249,7 +249,7 @@ typedef struct lang_input_statement_struct
const char *target; const char *target;
unsigned int is_archive : 1; unsigned int maybe_archive : 1;
/* 1 means search a set of directories for this file. */ /* 1 means search a set of directories for this file. */
unsigned int search_dirs_flag : 1; unsigned int search_dirs_flag : 1;