Use bfd_get_filename throughout ld

* emultempl/beos.em (sort_by_file_name): Use bfd_get_filename
	rather than accessing bfd->filename directly.
	* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Likewise.
	* emultempl/pep.em (gld_${EMULATION_NAME}_after_open): Likewise.
	* emultempl/spuelf.em (embedded_spu_file): Likewise.
	* ldlang.c (input_statement_is_archive_path, wild_sort),
	(check_excluded_libs): Likewise.
	* ldmain.c (add_archive_element): Likewise.
	* ldmisc.c (vfinfo): Likewise.
	* pe-dll.c (auto_export, generate_edata, pe_create_import_fixup),
	(pe_dll_generate_implib, pe_process_import_defs): Likewise.
	* plugin.c (plugin_object_p): Likewise.
This commit is contained in:
Alan Modra 2020-05-19 12:57:15 +09:30
parent 69f57659c3
commit 607b483327
10 changed files with 80 additions and 55 deletions

View file

@ -232,7 +232,7 @@ input_statement_is_archive_path (const char *file_spec, char *sep,
if (sep != file_spec)
{
const char *aname = f->the_bfd->my_archive->filename;
const char *aname = bfd_get_filename (f->the_bfd->my_archive);
*sep = 0;
match = name_match (file_spec, aname) == 0;
*sep = link_info.path_separator;
@ -294,7 +294,7 @@ walk_wild_file_in_exclude_list (struct name_list *exclude_list,
else if (file->the_bfd != NULL
&& file->the_bfd->my_archive != NULL
&& name_match (list_tmp->name,
file->the_bfd->my_archive->filename) == 0)
bfd_get_filename (file->the_bfd->my_archive)) == 0)
return TRUE;
}
@ -2776,7 +2776,7 @@ wild_sort (lang_wild_statement_type *wild,
}
else
{
ln = ls->section->owner->filename;
ln = bfd_get_filename (ls->section->owner);
la = FALSE;
}
@ -2791,7 +2791,7 @@ wild_sort (lang_wild_statement_type *wild,
if (fa)
fn = file->filename;
if (la)
ln = ls->section->owner->filename;
ln = bfd_get_filename (ls->section->owner);
i = filename_cmp (fn, ln);
if (i > 0)
@ -2986,7 +2986,7 @@ check_excluded_libs (bfd *abfd)
while (lib)
{
int len = strlen (lib->name);
const char *filename = lbasename (abfd->filename);
const char *filename = lbasename (bfd_get_filename (abfd));
if (strcmp (lib->name, "ALL") == 0)
{