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

@@ -1191,7 +1191,7 @@ plugin_object_p (bfd *ibfd)
/* We create a dummy BFD, initially empty, to house whatever symbols
the plugin may want to add. */
abfd = plugin_get_ir_dummy_bfd (ibfd->filename, ibfd);
abfd = plugin_get_ir_dummy_bfd (bfd_get_filename (ibfd), ibfd);
input = bfd_alloc (abfd, sizeof (*input));
if (input == NULL)
@@ -1201,7 +1201,7 @@ plugin_object_p (bfd *ibfd)
if (!bfd_plugin_open_input (ibfd, &file))
return NULL;
if (file.name == ibfd->filename)
if (file.name == bfd_get_filename (ibfd))
{
/* We must copy filename attached to ibfd if it is not an archive
member since it may be freed by bfd_close below. */
@@ -1217,7 +1217,7 @@ plugin_object_p (bfd *ibfd)
input->use_mmap = FALSE;
input->offset = file.offset;
input->filesize = file.filesize;
input->name = plugin_strdup (abfd, ibfd->filename);
input->name = plugin_strdup (abfd, bfd_get_filename (ibfd));
claimed = 0;