* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Simplify

comparison and replacement of filenames.
This commit is contained in:
Danny Smith
2004-10-19 20:07:32 +00:00
parent f2cb65cafb
commit 2a08daf3f5
2 changed files with 15 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2004-10-19 Danny Smith <dannysmith@users.sourceforge.net>
* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Simplify
comparison and replacement of filenames.
2004-10-19 H.J. Lu <hongjiu.lu@intel.com> 2004-10-19 H.J. Lu <hongjiu.lu@intel.com>
PR 459 PR 459

View File

@ -1078,7 +1078,7 @@ gld_${EMULATION_NAME}_after_open (void)
{ {
struct bfd_symbol *s; struct bfd_symbol *s;
struct bfd_link_hash_entry * blhe; struct bfd_link_hash_entry * blhe;
bfd *other_bfd; char *other_bfd_filename;
char *n; char *n;
s = (relocs[i]->sym_ptr_ptr)[0]; s = (relocs[i]->sym_ptr_ptr)[0];
@ -1095,20 +1095,19 @@ gld_${EMULATION_NAME}_after_open (void)
|| blhe->type != bfd_link_hash_defined) || blhe->type != bfd_link_hash_defined)
continue; continue;
other_bfd = blhe->u.def.section->owner; other_bfd_filename
#define bfd_filename(bfd) ((bfd)->my_archive ? bfd_get_filename ((bfd)->my_archive) : bfd_get_filename (bfd)) = blhe->u.def.section->owner->my_archive
? bfd_get_filename (blhe->u.def.section->owner->my_archive)
: bfd_get_filename (blhe->u.def.section->owner);
if (strcmp (bfd_filename (is->the_bfd), if (strcmp (bfd_get_filename (is->the_bfd->my_archive),
bfd_filename (other_bfd)) == 0) other_bfd_filename) == 0)
continue; continue;
/* Rename this implib to match the other one. */ /* Rename this implib to match the other one. */
n = xmalloc (strlen (bfd_filename (other_bfd)) + 1); n = xmalloc (strlen (other_bfd_filename) + 1);
strcpy (n, other_bfd_filename);
strcpy (n, bfd_filename (other_bfd)); is->the_bfd->my_archive->filename = n;
bfd_filename (is->the_bfd) = n;
#undef bfd_filename
} }
free (relocs); free (relocs);